|
| 1 | +# Contributing Guidelines |
| 2 | + |
| 3 | +## Legal |
| 4 | + |
| 5 | +Contributions must be all your own work; plagiarism is not allowed. |
| 6 | +By submitting a pull request, you agree to license your contribution |
| 7 | +under the [license of this repository](https://github.com/TheAlgorithms/Algorithms-Explanation/blob/master/LICENSE.md). |
| 8 | + |
| 9 | +## Translations |
| 10 | + |
| 11 | +Translations go in the appropriate folder named by the locale code. |
| 12 | + |
| 13 | +Do not change the structure or formatting of the original (English) explanation when translating or updating translations. |
| 14 | +You may change number formatting to fit the locale |
| 15 | +(`42.33` may be formatted as `42,33` in a german translation for instance) |
| 16 | +as long as it doesn't create ambiguities |
| 17 | +(e.g. `[42,33, 13]` in an array would be disallowed and should either remain `[42.33, 13]` or use a different delimiter `[42,33; 13]`). |
| 18 | + |
| 19 | +## Writing Explanations |
| 20 | + |
| 21 | +See the [explanation of the Euclidean Algorithm](en/Basic%20Math/Euclidean%20algorithm.md) |
| 22 | +for an example of how a good explanation may look like. |
| 23 | + |
| 24 | +### Structure |
| 25 | + |
| 26 | +You should structure your explanations using headings. |
| 27 | +The top-level heading should be the name of the algorithm or data structure to be explained |
| 28 | + |
| 29 | +Subsequent sub-headings *may* be: |
| 30 | + |
| 31 | +1. Problem solved by the algorithm |
| 32 | +2. Design/approach of the algorithm |
| 33 | +3. Detailed (yet not too technical) description of the algorithm, usually including (pseudo)-code |
| 34 | +4. Analysis (proof of correctness, best/worst/average cases, time & space complexity) |
| 35 | +5. Walkthrough(s) of how the algorithm processes example input(s) |
| 36 | +6. Application(s) of the algorithm |
| 37 | +7. Further resources such as reference implementations, videos or other explanations |
| 38 | + |
| 39 | +### Capitalization |
| 40 | + |
| 41 | +- Use *Title Case* for headings. |
| 42 | +- Start new sentences with a capital letter. |
| 43 | + |
| 44 | +### Typographical Conventions |
| 45 | + |
| 46 | +- Leave a space after punctuation such as `.`, `!`, `?`, `,`, `;` or `:`. |
| 47 | +- Add a space before and after `-`. **Do not add a space before punctuation.** |
| 48 | +- Add a space before an opening parenthesis `(`. Do not add a space before the closing parenthesis `)`. |
| 49 | +- Add spaces around (but not inside) quotes. Use single quotes for quotes within quotes. |
| 50 | + |
| 51 | +### Markdown Conventions |
| 52 | + |
| 53 | +[GitHub-flavored Markdown is used](https://github.github.com/gfm/). Explanations should render well when viewed from GitHub. |
| 54 | + |
| 55 | +- **Do not add redundant formatting.** Formatting should always be meaningful. |
| 56 | + If you apply a certain formatting to all elements of a certain kind (e.g. adding emphasis around all headings), you're doing something wrong. |
| 57 | +- Use ATX-style "hashtag" headings: `#`, `##`, `###`, `####`, `#####`, `######` rather than Setext-style "underline" headings. |
| 58 | + Leave blank lines around headings. The first heading should always be `# Title`. Subheadings must be exactly one level deeper than their parents. |
| 59 | +- Indent lists by two blanks. Prefer `-` over `*` for bulleted lists. Enumerate numbered lists correctly, starting at `1`. |
| 60 | +- Use fenced code blocks (and specify the correct language) rather than using indented code blocks. |
| 61 | + Format code inside fenced code blocks properly (prefer pseudocode over code though). Leave blank lines around fenced code blocks. |
| 62 | +- Use named links `[name](link)` rather than relying on automatic link detection or using `<>`-links. |
| 63 | + There are rarely good reasons to not give a link a descriptive name. |
| 64 | +- Use HTML only if necessary (rarely - if ever - the case). Do not use HTML for unnecessary formatting. |
0 commit comments