fix(docs): update terminology for challenges (#42595)

pull/42602/head
Shaun Hamilton 2021-06-23 00:59:30 +01:00 committed by GitHub
parent 7defcaf58e
commit b96ebf7663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 27 deletions

View File

@ -31,11 +31,11 @@ Before you work on the curriculum, you would need to set up some tooling to help
### How to work on practice projects
The practice projects have some additional tooling to help create new projects and steps. To read more, see [these docs](how-to-work-on-practice-projects.md)
The practice projects have some additional tooling to help create new projects and steps. To read more, see [these docs](how-to-work-on-practice-projects.md)
## Challenge Template
````md
---
id: Unique identifier (alphanumerical, MongoDB_id)
title: 'Challenge Title'
@ -49,9 +49,7 @@ forumTopicId: 12345
Challenge description text, in markdown
```html
<div>
example code
</div>
<div>example code</div>
```
# --instructions--
@ -92,9 +90,7 @@ Boilerplate code to render to the editor. This section should only contain code
```html
<body>
<p class="main-text">
Hello world!
</p>
<p class="main-text">Hello world!</p>
</body>
```
@ -156,17 +152,15 @@ More answers
## --video-solution--
The number for the correct answer goes here.
````
> [!NOTE]
>
> 1. In the above sections, examples of `lang` are:
>
> - `html` - HTML/CSS
> - `js` - JavaScript
> - `jsx` - JSX
> - `html` - HTML/CSS
> - `js` - JavaScript
> - `jsx` - JSX
## Numbering Challenges
@ -231,7 +225,7 @@ Proper nouns should use correct capitalization when possible. Below is a list of
- JavaScript (capital letters in "J" and "S" and no abbreviations)
- Node.js
- Front-end development (adjective form with a dash) is when you're working on the front end (noun form with no dash). The same goes with "back end", "full stack", and many other compound terms.
- Although sometimes inaccurate, non-hyphenated forms of 'back end' and 'front end' should be used, as they are more widely used.
### The 2-minute rule
@ -260,16 +254,19 @@ Here are specific formatting guidelines for challenge text and examples:
- Language keywords go in `\`` backticks. For example, HTML tag names or CSS property names.
- References to code parts (i.e. function, method, or variable names) should be wrapped in `\`` backticks. See example below:
```md
Use `parseInt` to convert the variable `realNumber` into an integer.
```
- References to file names and path directories (e.g. `package.json`, `src/components`) should be wrapped in `\`` backticks.
- Multi-line code blocks **must be preceded by an empty line**. The next line must start with three backticks followed immediately by one of the [supported languages](https://prismjs.com/#supported-languages). To complete the code block, you must start a new line which only has three backticks and **another empty line**. See example below:
- Whitespace matters in Markdown, so we recommend that you make it visible in your editor.
- Whitespace matters in Markdown, so we recommend that you make it visible in your editor.
**Note:** If you are going to use an example code in YAML, use `yaml` instead of `yml` for the language to the right of the backticks.
The following is an example of code:
````md
```{language}
@ -304,7 +301,7 @@ Here are specific formatting guidelines for the challenge seed code:
We have a [comment dictionary](/curriculum/dictionaries/english/comments.js) that contains the only comments that can be used within the seed code. The exact case and spacing of the dictionary comment must be used. The comment dictionary should not be expanded without prior discussion with the dev-team.
Comments used should have a space between the comment characters and the comment themselves. In general, comments should be used sparingly. Always consider rewriting a challenge's description or instructions if it could avoid using a seed code comment.
Comments used should have a space between the comment characters and the comment themselves. In general, comments should be used sparingly. Always consider rewriting a challenge's description or instructions if it could avoid using a seed code comment.
Example of valid single line JavaScript comment:
@ -338,7 +335,7 @@ class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
text: "Hello"
text: 'Hello'
};
// Change code below this line
@ -346,33 +343,33 @@ class MyComponent extends React.Component {
}
handleClick() {
this.setState({
text: "You clicked!"
text: 'You clicked!'
});
}
render() {
return (
<div>
{ /* Change code below this line */ }
{/* Change code below this line */}
<button>Click Me</button>
{ /* Change code above this line */ }
{/* Change code above this line */}
<h1>{this.state.text}</h1>
</div>
);
}
};
}
```
### Translation of seed code comments
There are separate comment dictionaries for each language. The [English version of the comment dictionary](/curriculum/dictionaries/english/comments.js) is the basis for the translations found in the corresponding non-English versions of the files. The non-English version of the Chinese comment dictionary would be located at `/curriculum/dictionaries/chinese/comments.js`. Each dictionary consists of an array of objects with a unique `id` property and a `text` property. Only the `text` should be modified to encompass the translation of the corresponding English comment.
There are separate comment dictionaries for each language. The [English version of the comment dictionary](/curriculum/dictionaries/english/comments.js) is the basis for the translations found in the corresponding non-English versions of the files. The non-English version of the Chinese comment dictionary would be located at `/curriculum/dictionaries/chinese/comments.js`. Each dictionary consists of an array of objects with a unique `id` property and a `text` property. Only the `text` should be modified to encompass the translation of the corresponding English comment.
Some comments may contain a word/phrase that should not be translated. For example, variable names or proper library names like "React" should not be translated. See the comment below as an example. The word `myGlobal` should not be translated.
Some comments may contain a word/phrase that should not be translated. For example, variable names or proper library names like "React" should not be translated. See the comment below as an example. The word `myGlobal` should not be translated.
```text
Declare the myGlobal variable below this line
```
>[!NOTE]
> [!NOTE]
>
> We are working on an integration to make it possible to work on i18n for the comment dictionary.
@ -448,13 +445,13 @@ function myFunc() {
## Testing Challenges
Before you [create a pull request](how-to-open-a-pull-request.md) for your changes, you need to validate that the changes you have made do not inadvertently cause problems with the challenge.
Before you [create a pull request](how-to-open-a-pull-request.md) for your changes, you need to validate that the changes you have made do not inadvertently cause problems with the challenge.
1. To test all challenges run the below command from the root directory
```
npm run test:curriculum
```
```
2. You can also test a block or a superblock of challenges with these commands
@ -484,7 +481,7 @@ Once you have verified that each challenge you've worked on passes the tests, [p
> [!TIP]
> You can set the environment variable `LOCALE` in the `.env` to the language of the challenge(s) you need to test.
>
>
> The currently accepted values are `english` and `chinese`, with `english` being set by default.
### Useful Links