You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: anatomy/tracks/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Some parts of the track can be displayed in [widgets](./widgets.md), such as [co
35
35
36
36
## Style guide
37
37
38
-
The [style guide](./style-guide.md) records how documents should be written and formatted.
38
+
All documents should adhere to the [style guide](../../contributing/standards/style-guide.md). Markdown documents should also adhere to our [Markdown standards](../../contributing/standards/markdown.md).
Copy file name to clipboardExpand all lines: contributing/standards/markdown.md
+94-2Lines changed: 94 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The following is the way that all Markdown files within Exercism should be structured.
4
4
5
-
Some of the rules in this document are not yet implemented across all of Exercism.
5
+
Some of the rules in this document are not yet implemented across all of Exercism.
6
6
We welcome PRs to fix them.
7
7
All rules are being added to our CI and linting tools, and should be adhered to for new changes.
8
8
@@ -14,13 +14,93 @@ All rules are being added to our CI and linting tools, and should be adhered to
14
14
- No heading may decend a level greater than one below the previous (e.g. `##` may only be followed by `###`, not `####`).
15
15
- Beyond the single level-1 (`#`) heading, only level-2 (`##`), level-3 (`###`) and level-4 (`####`) headings may be used.
16
16
17
+
## Links
18
+
19
+
Please use [reference links](https://spec.commonmark.org/0.29/#reference-link), which are defined at the bottom of the Markdown file, mapped to a reference slug, and referenced by that slug in the text.
20
+
21
+
This method makes maintenance easier, since link only have to be updated in a single location.
22
+
23
+
Example:
24
+
25
+
```
26
+
I have a paragraph of text that links to the same page twice.
27
+
28
+
The [first link][indirect-reference] in one sentence.
29
+
30
+
Then, another sentence with the [link repeated][indirect-reference].
Links should always have anchor text, instead of putting the URL itself into the text. For example, the following does not use anchor text, and is harder to read.
36
+
37
+
```
38
+
If you want some more information, please visit https://google.com.
39
+
```
40
+
41
+
Using anchor text and linking it is easier to understand and contextualize.
42
+
43
+
```
44
+
If you want some more information, [Google][google-search-link] is a useful resource.
45
+
46
+
[google-link]: https://google.com
47
+
```
48
+
49
+
Which renders as, "If you want some more information, [Google](https://google.com)".
50
+
51
+
## Code
52
+
53
+
Whenever one refers to code elements (e.g. functions or keywords), the code should be wrapped in backticks:
54
+
55
+
```
56
+
- The `printf()` function writes to the console.
57
+
```
58
+
59
+
Which renders as:
60
+
61
+
- The `printf()` function writes to the console.
62
+
63
+
More complex code (e.g. multiline code) should be wrapped in triple backticks. A [language identifier](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml) should be specified after the opening triple backticks to enable syntax highlighting:
64
+
65
+
````python
66
+
```python
67
+
# Define a variable
68
+
album ="Abbey Road"
69
+
```
70
+
````
71
+
72
+
When possible, format code in a way that is most relevant to the environment it is being presented in. If available, please reference the docs for your language.
73
+
74
+
For example, Python has the REPL (read-eval-print loop), which allows a programmer to type code directly into a terminal. If a user was debugging some code, or running a function locally to test/observe how it works, they are more likely to use a REPL to do so, since it is more convenient to type interactively there. In this situation, we prefer formatting example code as if it was being typed into the REPL, with a leading `>>>`:
75
+
76
+
```python
77
+
# This is the expected output a student would see while testing a function they wrote.
In other cases, it makes more sense to leave code formatted as if it was in a `.py` file. Here, the student benefits by being presented with something that mimics how they would write the code themselves.
83
+
84
+
```python
85
+
# presenting how functions are defined in Python:
86
+
defsample_func(argument1):
87
+
pass
88
+
```
89
+
90
+
A quick way to distinguish between the two cases when it's unclear - if this is code the student can run in a terminal, format it that way. If it's code that Exercism might run (in tests, library code the student will write, etc), default to formatting it as runnable code.
91
+
92
+
## Language Code Style
93
+
94
+
Please consult each language's docs folder for more information on the preferred style conventions for that language. All exercises of a language should use a consistent coding style.
95
+
17
96
## Layout
18
97
19
98
### One sentence per line
20
99
21
100
Paragraphs should be laid at using one sentence per line. The [Ascii Doctor docs][asciidoctor] explain the logic of this clearly.
22
101
23
102
For example, a single paragraph should be laid out as follows:
103
+
24
104
```
25
105
Exercism has been designed, engineered and built by thousands of very talented individuals.
26
106
Nearly everything with Exercism has been debated, discussed and rewritten many times.
@@ -35,12 +115,24 @@ Exercism is a very intentional product - things are there because they've been d
35
115
## Linters
36
116
37
117
There are various rules you can use to configure linters to meet this spec:
Some repositories use [prettier](https://prettier.io/) to ensure that all Markdown is formatted consistently. This can result in the following benefits:
128
+
129
+
- No formatting discussions.
130
+
- Great editor/IDE integration so files can be formatted on save.
131
+
- Easy to add CI checks for formatting.
132
+
- Easy to automatically format files using a script.
133
+
134
+
All the above can greatly help reduce churn in reviews, whch is frustrating for both the reviewer and the reviewee.
Copy file name to clipboardExpand all lines: contributing/standards/style-guide.md
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,44 +4,48 @@ This document acts as a Style Guide for the language and wording used in exercis
4
4
5
5
## Application
6
6
7
-
These rules should be followed in all exercises.
7
+
These rules should be followed in all exercises.
8
8
Existing descriptions and test-cases can be updated to adhere to them without requiring "replacement" test cases.
9
9
10
10
### Consistency within an exercise.
11
11
12
-
There are some terms that have multiple valid spellings (e.g. "lower case" vs "lowercase").
12
+
There are some terms that have multiple valid spellings (e.g. "lower case" vs "lowercase").
13
13
Where a consistent style has not been agreed within this document, these must be consistent within an exercise.
14
14
15
15
### Exceptions
16
16
17
-
Exercises may vary from these rules if there is general consensus across maintainers that this is reasonable.
17
+
Exercises may vary from these rules if there is general consensus across maintainers that this is reasonable.
18
18
For example, an exercise about converting between different units might choose not to use SI measurements.
19
19
20
20
## Language
21
21
22
-
All content should be written in US English. In the future other translations may occur, but the "official" Exercism language is US English.
22
+
All content should be written in US English, which differs from UK English in a [variety of ways](https://en.wikipedia.org/wiki/Comparison_of_American_and_British_English). In the future other translations may occur, but the "official" Exercism language is US English.
23
23
24
24
### Measurements
25
+
25
26
All units of measurement must be [SI](https://en.wikipedia.org/wiki/International_System_of_Units) or [SI-derived](https://en.wikipedia.org/wiki/SI_derived_unit) units.
26
27
27
28
### Abbreviations, acronyms and initialisms
28
29
29
30
Abbreviations, acronyms and initialisms are often more difficult to understand than other phrasing options, and can alienate people trying to learn.
30
31
31
32
Many abbreviations are jargon. Avoid jargon where possible by using alternative language. Don't use abbreviations unless either:
33
+
32
34
- The abbreviated term is better known than the unabbreviated term
33
35
- The text will be excessively verbose without abbreviation
34
36
35
37
When using abbreviations always explain what the term means on its first use. This will often, but not always, include expanding the abbreviation. It will rarely be sufficient to only expand the abbreviation.
36
38
37
39
Here are some example rules:
40
+
38
41
- Prefer "if I recall correctly" to "IIRC"
39
42
- Prefer "as far as I know" to "AFAIK"
40
43
- Prefer "queue" to "FIFO" and "stack" to "FILO"
41
44
- Instead of describing an interface as "RESTful", describe it's specific properties
42
45
- If you must use "CRUD", explain that it stands for Create, Read, Update, Delete and that these are the basic actions in standard databases
43
46
44
47
An some examples of good usage:
48
+
45
49
- "HyperText Markup Language (HTML) is the language used to describe document structure and content on the web" _(expanded and explained)_
46
50
- "DNA, a set of chemical instructions that influence how our bodies are constructed" _(DNA is not expanded because "deoxyribonucleic acid" is unlikely to help explain what DNA is to our audience)_
47
51
- "NASA, the United States' space agency, launched the Mariner 2 space probe in..." _(NASA is not expanded because the "National Aerospace and Space Administration" is much better known by its acronym than by its expanded name)_
@@ -56,6 +60,7 @@ Use the "[Oxford Comma](https://en.wikipedia.org/wiki/Serial_comma)" (also known
56
60
#### Exceptions
57
61
58
62
Some abbreviations are considered common, useful, and non-technical enough that we have decided to permit them:
63
+
59
64
-`e.g.` or `eg`
60
65
-`i.e.` or `ie`
61
66
-`etc.` or `etc`
@@ -70,6 +75,7 @@ Contractions (e.g. "won't", "I'm", "that's") should be used sparingly if at all
70
75
In any place that mathematical terms are used they should be explained or substituted out for terms that require less domain knowledge.
71
76
72
77
Examples:
78
+
73
79
- Rather than using "natural numbers", we should use "positive whole numbers".
74
80
- If we want to use the phrase "rational numbers", it must be explained in the introduction to the exercise.
75
81
- Rather than using the word range (which can have different meanings in different contexts) use "x < ? < y (greater than x and less than y)".
0 commit comments