|
| 1 | +:orphan: |
| 2 | + |
| 3 | +========================= |
| 4 | +Documentation Conventions |
| 5 | +========================= |
| 6 | + |
| 7 | +This document describes the conventions used in pip's documentation. We |
| 8 | +expect it to evolve over time as additional conventions are identified |
| 9 | +and past conventions are rendered obsolete. |
| 10 | + |
| 11 | +.. note:: |
| 12 | + |
| 13 | + Currently, these conventions are not enforced automatically, and |
| 14 | + need to be verified manually during code review. We are interested |
| 15 | + in linters that can help us enforce these conventions automatically. |
| 16 | + |
| 17 | + |
| 18 | +Files |
| 19 | +===== |
| 20 | + |
| 21 | +Naming |
| 22 | +------ |
| 23 | + |
| 24 | +Folder names should be a single word, all lowercase. |
| 25 | + |
| 26 | +File names must use the kebab-case style (all lowercase, hyphen for |
| 27 | +separating words) and have the extension ``.rst``. |
| 28 | + |
| 29 | +Encoding |
| 30 | +-------- |
| 31 | + |
| 32 | +All files in our documentation must use UTF-8 encoding. |
| 33 | + |
| 34 | + |
| 35 | +File Layout |
| 36 | +=========== |
| 37 | + |
| 38 | +Line Length |
| 39 | +----------- |
| 40 | + |
| 41 | +Limit all lines to a maximum of 72 characters, where possible. This may |
| 42 | +be exceeded when it does not make sense to abide by it (eg. long links, |
| 43 | +code blocks). |
| 44 | + |
| 45 | +Indentation |
| 46 | +----------- |
| 47 | + |
| 48 | +We use 4 spaces for indentation. |
| 49 | + |
| 50 | +:: |
| 51 | + |
| 52 | + .. note:: |
| 53 | + |
| 54 | + Directive blocks |
| 55 | + |
| 56 | + :: |
| 57 | + |
| 58 | + Code block. |
| 59 | + |
| 60 | +Bullet lists are the only exception to the 4 spaces rule, using 2 spaces |
| 61 | +when wrapping lines. |
| 62 | + |
| 63 | +:: |
| 64 | + |
| 65 | + - This is a bullet list. |
| 66 | + - This is a lot of text in a single bullet which would require wrapping |
| 67 | + across multiple lines to fit in the line length limits. |
| 68 | + |
| 69 | + |
| 70 | +Headings |
| 71 | +======== |
| 72 | + |
| 73 | +Use the following symbols to create headings: |
| 74 | + |
| 75 | +#. ``=`` with overline |
| 76 | +#. ``=`` |
| 77 | +#. ``-`` |
| 78 | +#. ``^`` |
| 79 | +#. ``'`` |
| 80 | +#. ``*`` |
| 81 | + |
| 82 | +For visual separation from the rest of the content, all other headings |
| 83 | +must have one empty line before and after. Heading 2 (``=``) should have |
| 84 | +two empty lines before, for indicating the end of the section prior to |
| 85 | +it. |
| 86 | + |
| 87 | +:: |
| 88 | + |
| 89 | + ========= |
| 90 | + Heading 1 |
| 91 | + ========= |
| 92 | + |
| 93 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 94 | + |
| 95 | + |
| 96 | + Heading 2 |
| 97 | + ========= |
| 98 | + |
| 99 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 100 | + |
| 101 | + Heading 3 |
| 102 | + --------- |
| 103 | + |
| 104 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 105 | + |
| 106 | + Heading 4 |
| 107 | + ^^^^^^^^^ |
| 108 | + |
| 109 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 110 | + |
| 111 | + Heading 5 |
| 112 | + ''''''''' |
| 113 | + |
| 114 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 115 | + |
| 116 | + Heading 6 |
| 117 | + ********* |
| 118 | + |
| 119 | + Lorem ipsum dolor sit amet consectetur adipisicing elit. |
| 120 | + |
| 121 | + |
| 122 | +Writing |
| 123 | +======= |
| 124 | + |
| 125 | +pip is a proper noun, and spelt all lowercase. Do not capitalize pip as |
| 126 | +"Pip" at the start of a sentence. |
| 127 | + |
| 128 | +Avoid using phrases such as "easy", "just", "simply" etc, which imply |
| 129 | +that the task is trivial. If it were trivial, the user wouldn't be |
| 130 | +reading the documentation for it. |
0 commit comments