fix(docs): add formatting instructions for coding challenge text (#39660)
* fix(docs): add formatting instructions * add note about markdown * fix: mention preference to use single-quotes Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@ -209,13 +209,15 @@ Our goal is to have thousands of 2-minute challenges. These can flow together an
|
|||||||
Here are specific formatting guidelines for challenge text and examples:
|
Here are specific formatting guidelines for challenge text and examples:
|
||||||
|
|
||||||
- Language keywords go in `<code>` tags. For example, HTML tag names or CSS property names
|
- Language keywords go in `<code>` tags. For example, HTML tag names or CSS property names
|
||||||
- The first instance of a keyword when it's being defined, or general keywords (i.e. "object" or "immutable") go in `<dfn>` tags
|
- The first instance of a keyword when it's being defined, or general keywords (e.g. "object" or "immutable") go in `<dfn>` tags
|
||||||
- References to code parts (i.e. function, method or variable names) should be wrapped in `<code>` tags. See example below:
|
- References to code parts (i.e. function, method or variable names) should be wrapped in `<code>` tags. See example below:
|
||||||
- Use <code>parseInt</code> to convert the variable <code>realNumber</code> into an integer.
|
```md
|
||||||
- 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 newline which only has three backticks and **another empty line**.
|
Use <code>parseInt</code> to convert the variable <code>realNumber</code> into an integer.
|
||||||
**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.
|
```
|
||||||
|
- References to file names and path directories (e.g. `package.json`, `src/components`) should be wrapped in `<code>` tags.
|
||||||
|
- 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 newline which only has three backticks and **another empty line**. See example below:
|
||||||
|
|
||||||
See example below:
|
**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.
|
||||||
|
|
||||||
````md
|
````md
|
||||||
The following is an example of code:
|
The following is an example of code:
|
||||||
@ -229,7 +231,9 @@ The following is an example of code:
|
|||||||
|
|
||||||
- Additional information in the form of a note should be formatted `<strong>Note:</strong> Rest of note text...`
|
- Additional information in the form of a note should be formatted `<strong>Note:</strong> Rest of note text...`
|
||||||
- If multiple notes are needed, then list all of the notes in separate sentences using the format `<strong>Notes:</strong> First note text. Second note text.`.
|
- If multiple notes are needed, then list all of the notes in separate sentences using the format `<strong>Notes:</strong> First note text. Second note text.`.
|
||||||
- Use double quotes where applicable
|
- Use single-quotes where applicable
|
||||||
|
|
||||||
|
**Note:** The equivalent _Markdown_ should be used, where applicable, in place of _HTML_ tags.
|
||||||
|
|
||||||
## Writing tests
|
## Writing tests
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user