diff options
| author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2024-05-02 08:10:09 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-05-15 09:44:16 -0700 |
| commit | 5c841acbab59e86b294c91e69fe543152fd54e82 (patch) | |
| tree | f8ef0b767b8dad922118e1f6683a2a442d6e3916 /documentation/standards.md | |
| parent | 8e81c67e12f64b42f09d7eab30e9d1633160bf87 (diff) | |
| download | poky-5c841acbab59e86b294c91e69fe543152fd54e82.tar.gz | |
documentation: standards.md: align with master branch
(From yocto-docs rev: ecc1731d6bd2f3bce40010bbfa3b608dcf25dd04)
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation/standards.md')
| -rw-r--r-- | documentation/standards.md | 97 |
1 files changed, 94 insertions, 3 deletions
diff --git a/documentation/standards.md b/documentation/standards.md index d3b25adfab..bc403e393e 100644 --- a/documentation/standards.md +++ b/documentation/standards.md | |||
| @@ -22,7 +22,92 @@ what Wikipedia or the project defining this word uses. | |||
| 22 | 22 | ||
| 23 | ## Text standards | 23 | ## Text standards |
| 24 | 24 | ||
| 25 | This section has not been filled yet | 25 | ### Bulleted lists |
| 26 | |||
| 27 | Though Sphinx supports both the ``*`` and ``-`` characters | ||
| 28 | for introducing bulleted lists, we have chosen to use | ||
| 29 | only ``-`` for this purpose. | ||
| 30 | |||
| 31 | Though not strictly required by Sphinx, we have also chosen | ||
| 32 | to use two space characters after ``-`` to introduce each | ||
| 33 | list item: | ||
| 34 | |||
| 35 | - Paragraph 1 | ||
| 36 | |||
| 37 | - Paragraph 2 | ||
| 38 | |||
| 39 | As shown in the above example, there should also be an empty | ||
| 40 | line between each list item. | ||
| 41 | |||
| 42 | An exception to this rule is when the list items are just made | ||
| 43 | of a few words, instead of entire paragraphs: | ||
| 44 | |||
| 45 | - Item 1 | ||
| 46 | - Item 2 | ||
| 47 | |||
| 48 | This is again a matter of style, not syntax. | ||
| 49 | |||
| 50 | ### Line wrapping | ||
| 51 | |||
| 52 | Source code for the documentation shouldn't have lines | ||
| 53 | wider than 80 characters. This makes patch lines more | ||
| 54 | readable and code easier to quote in e-mail clients. | ||
| 55 | |||
| 56 | If you have to include long commands or lines in configuration | ||
| 57 | files, provided the syntax makes this possible, split them | ||
| 58 | into multiple lines, using the ``\`` character. | ||
| 59 | |||
| 60 | Here is an example: | ||
| 61 | |||
| 62 | $ scripts/install-buildtools \ | ||
| 63 | --without-extended-buildtools \ | ||
| 64 | --base-url https://downloads.yoctoproject.org/releases/yocto \ | ||
| 65 | --release yocto-4.0.1 \ | ||
| 66 | --installer-version 4.0.1 | ||
| 67 | |||
| 68 | Exceptions are granted for file contents whose lines | ||
| 69 | cannot be split without infringing syntactic rules | ||
| 70 | or reducing readability, as well as for command output | ||
| 71 | which should be kept unmodified. | ||
| 72 | |||
| 73 | ### File, tool and command names | ||
| 74 | |||
| 75 | File, tool, command and package names should be double tick-quoted. | ||
| 76 | For example, ``` ``conf/local.conf`` ``` is preferred over | ||
| 77 | `"conf/local.conf"`. | ||
| 78 | |||
| 79 | ### Project names | ||
| 80 | |||
| 81 | Project names should be introduced with single quotes, to have them rendered | ||
| 82 | with an italic font and make them easier to distinguish from command names | ||
| 83 | (double tick-quoted) and from regular English words. | ||
| 84 | |||
| 85 | An exception is when project names appear in hyperlinks, as nested markup | ||
| 86 | is not supported by Sphinx yet. | ||
| 87 | |||
| 88 | Project names should also be capitalized (or not) in the same way they are on | ||
| 89 | Wikipedia, or on their own project pages if they are not described on | ||
| 90 | Wikipedia. If a project name isn't capitalized, it should remain so even | ||
| 91 | at the beginning of a sentence. | ||
| 92 | |||
| 93 | For example: | ||
| 94 | |||
| 95 | * ``` `BitBake` ``` | ||
| 96 | * ``` `ftrace` ``` | ||
| 97 | |||
| 98 | ### Variables | ||
| 99 | |||
| 100 | Every variable should be mentioned with: | ||
| 101 | |||
| 102 | :term:`VARIABLE` | ||
| 103 | |||
| 104 | This assumes that `VARIABLE` is described either | ||
| 105 | in the Yocto Project documentation variable index (`ref-manual/variables.rst`) | ||
| 106 | or in the BitBake User Manual | ||
| 107 | (`doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst`) | ||
| 108 | |||
| 109 | If it is not described yet, the variable should be added to the | ||
| 110 | glossary before or in the same patch it is used, so that `:term:` can be used. | ||
| 26 | 111 | ||
| 27 | ## ReStructured Text Syntax standards | 112 | ## ReStructured Text Syntax standards |
| 28 | 113 | ||
| @@ -41,8 +126,14 @@ To include a screenshot in PNG format: | |||
| 41 | .. image:: figures/user-configuration.png | 126 | .. image:: figures/user-configuration.png |
| 42 | :align: center | 127 | :align: center |
| 43 | 128 | ||
| 44 | Depending on the size of the image, you may also shrink it | 129 | A diagram with many details usually needs to use |
| 45 | to prevent it from filling the whole page width: | 130 | the whole page width to be readable on all media. |
| 131 | In this case, the `:align:` directive is unnecessary: | ||
| 132 | |||
| 133 | :scale: 100% | ||
| 134 | |||
| 135 | Conversely, you may also shrink some images to | ||
| 136 | to prevent them from filling the whole page width: | ||
| 46 | 137 | ||
| 47 | :scale: 50% | 138 | :scale: 50% |
| 48 | 139 | ||
