Skip to content

Commit

Permalink
fix(docs): add formatting instructions for coding challenge text (#39660
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
ShaunSHamilton and ojeytonwilliams committed Oct 15, 2020
1 parent cc464a6 commit 6de5144
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docs/how-to-work-on-coding-challenges.md
Expand Up @@ -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:

- 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:
- Use <code>parseInt</code> to convert the variable <code>realNumber</code> into an integer.
- 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**.
**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.

See example below:
```md
Use <code>parseInt</code> to convert the variable <code>realNumber</code> into an integer.
```
- 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:

**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
The following is an example of code:
Expand All @@ -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...`
- 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

Expand Down

0 comments on commit 6de5144

Please sign in to comment.