diff options
Diffstat (limited to 'documentation/README')
-rw-r--r-- | documentation/README | 180 |
1 files changed, 132 insertions, 48 deletions
diff --git a/documentation/README b/documentation/README index be03bb119a..b60472fcbf 100644 --- a/documentation/README +++ b/documentation/README | |||
@@ -32,28 +32,25 @@ these instances. | |||
32 | Manual Organization | 32 | Manual Organization |
33 | =================== | 33 | =================== |
34 | 34 | ||
35 | Folders exist for individual manuals as follows: | 35 | Here the folders corresponding to individual manuals: |
36 | 36 | ||
37 | * sdk-manual - The Yocto Project Software Development Kit (SDK) Developer's Guide. | 37 | * brief-yoctoprojectqs - Yocto Project Quick Start |
38 | * bsp-guide - The Yocto Project Board Support Package (BSP) Developer's Guide | 38 | * overview-manual - Yocto Project Overview and Concepts Manual |
39 | * dev-manual - The Yocto Project Development Tasks Manual | 39 | * contributor-guide - Yocto Project and OpenEmbedded Contributor Guide |
40 | * kernel-dev - The Yocto Project Linux Kernel Development Tasks Manual | 40 | * ref-manual - Yocto Project Reference Manual |
41 | * ref-manual - The Yocto Project Reference Manual | 41 | * bsp-guide - Yocto Project Board Support Package (BSP) Developer's Guide |
42 | * brief-yoctoprojectqs - The Yocto Project Quick Start | 42 | * dev-manual - Yocto Project Development Tasks Manual |
43 | * profile-manual - The Yocto Project Profile and Tracing Manual | 43 | * kernel-dev - Yocto Project Linux Kernel Development Manual |
44 | * toaster-manual - The Toaster Manual | 44 | * profile-manual - Yocto Project Profiling and Tracing Manual |
45 | * test-manual - The Test Environment Manual | 45 | * sdk-manual - Yocto Project Software Development Kit (SDK) Developer's Guide. |
46 | * toaster-manual - Toaster User Manual | ||
47 | * test-manual - Yocto Project Test Environment Manual | ||
48 | * migration-guides - Yocto Project Release and Migration Notes | ||
46 | 49 | ||
47 | Each folder is self-contained regarding content and figures. | 50 | Each folder is self-contained regarding content and figures. |
48 | 51 | ||
49 | If you want to find HTML versions of the Yocto Project manuals on the web, | 52 | If you want to find HTML versions of the Yocto Project manuals on the web, |
50 | go to https://www.yoctoproject.org and click on the "Documentation" tab. From | 53 | the current versions reside at https://docs.yoctoproject.org. |
51 | there you have access to archived documentation from previous releases, current | ||
52 | documentation for the latest release, and "Docs in Progress" for the release | ||
53 | currently being developed. | ||
54 | |||
55 | In general, the Yocto Project site (https://www.yoctoproject.org) is a great | ||
56 | reference for both information and downloads. | ||
57 | 54 | ||
58 | poky.yaml | 55 | poky.yaml |
59 | ========= | 56 | ========= |
@@ -61,9 +58,16 @@ poky.yaml | |||
61 | This file defines variables used for documentation production. The variables | 58 | This file defines variables used for documentation production. The variables |
62 | are used to define release pathnames, URLs for the published manuals, etc. | 59 | are used to define release pathnames, URLs for the published manuals, etc. |
63 | 60 | ||
64 | template | 61 | standards.md |
65 | ======== | 62 | ============ |
66 | Contains various templates, fonts, and some old PNG files. | 63 | |
64 | This file specifies some rules to follow when contributing to the documentation. | ||
65 | |||
66 | template/ | ||
67 | ========= | ||
68 | |||
69 | Contains a template.svg, to make it easier to create consistent | ||
70 | SVG diagrams. | ||
67 | 71 | ||
68 | Sphinx | 72 | Sphinx |
69 | ====== | 73 | ====== |
@@ -88,16 +92,16 @@ documentation. | |||
88 | Yocto Project documentation website | 92 | Yocto Project documentation website |
89 | =================================== | 93 | =================================== |
90 | 94 | ||
91 | A new website has been created to host the Yocto Project | 95 | The website hosting the Yocto Project documentation, can be found |
92 | documentation, it can be found at: https://docs.yoctoproject.org/. | 96 | at: https://docs.yoctoproject.org/. |
93 | 97 | ||
94 | The entire Yocto Project documentation, as well as the BitBake manual | 98 | The entire Yocto Project documentation, as well as the BitBake manual, |
95 | is published on this website, including all previously released | 99 | is published on this website, including all previously released |
96 | versions. A version switcher was added, as a drop-down menu on the top | 100 | versions. A version switcher was added, as a drop-down menu on the top |
97 | of the page to switch back and forth between the various versions of | 101 | of the page to switch back and forth between the various versions of |
98 | the current active Yocto Project releases. | 102 | the current active Yocto Project releases. |
99 | 103 | ||
100 | Transition pages have been added (as rst file) to show links to old | 104 | Transition pages have been added (as rst files) to show links to old |
101 | versions of the Yocto Project documentation with links to each manual | 105 | versions of the Yocto Project documentation with links to each manual |
102 | generated with DocBook. | 106 | generated with DocBook. |
103 | 107 | ||
@@ -109,15 +113,28 @@ obvious reasons, we will only support building the Yocto Project | |||
109 | documentation with Python3. | 113 | documentation with Python3. |
110 | 114 | ||
111 | Sphinx might be available in your Linux distro packages repositories, | 115 | Sphinx might be available in your Linux distro packages repositories, |
112 | however it is not recommend using distro packages, as they might be | 116 | however it is not recommended to use distro packages, as they might be |
113 | old versions, especially if you are using an LTS version of your | 117 | old versions, especially if you are using an LTS version of your |
114 | distro. The recommended method to install Sphinx and all required | 118 | distro. The recommended method to install the latest versions of Sphinx |
115 | dependencies is to use the Python Package Index (pip). | 119 | and of its required dependencies is to use the Python Package Index (pip). |
116 | 120 | ||
117 | To install all required packages run: | 121 | To install all required packages run: |
118 | 122 | ||
119 | $ pip3 install sphinx sphinx_rtd_theme pyyaml | 123 | $ pip3 install sphinx sphinx_rtd_theme pyyaml |
120 | 124 | ||
125 | To make sure you always have the latest versions of such packages, you | ||
126 | should regularly run the same command with an added "--upgrade" option: | ||
127 | |||
128 | $ pip3 install --upgrade sphinx sphinx_rtd_theme pyyaml | ||
129 | |||
130 | Also install the "inkscape" package from your distribution. | ||
131 | Inkscape is need to convert SVG graphics to PNG (for EPUB | ||
132 | export) and to PDF (for PDF export). | ||
133 | |||
134 | Additionally install "fncychap.sty" TeX font if you want to build PDFs. Debian | ||
135 | and Ubuntu have it in "texlive-latex-extra" package while RedHat distributions | ||
136 | and OpenSUSE have it in "texlive-fncychap" package for example. | ||
137 | |||
121 | To build the documentation locally, run: | 138 | To build the documentation locally, run: |
122 | 139 | ||
123 | $ cd documentation | 140 | $ cd documentation |
@@ -134,6 +151,34 @@ dependencies in a virtual environment: | |||
134 | $ pipenv install | 151 | $ pipenv install |
135 | $ pipenv run make html | 152 | $ pipenv run make html |
136 | 153 | ||
154 | Style checking the Yocto Project documentation | ||
155 | ============================================== | ||
156 | |||
157 | The project is starting to use Vale (https://vale.sh/) | ||
158 | to validate the text style. | ||
159 | |||
160 | To install Vale: | ||
161 | |||
162 | $ pip install vale | ||
163 | |||
164 | To run Vale: | ||
165 | |||
166 | $ make stylecheck | ||
167 | |||
168 | Link checking the Yocto Project documentation | ||
169 | ============================================= | ||
170 | |||
171 | To fix errors which are not reported by Sphinx itself, | ||
172 | the project uses sphinx-lint (https://github.com/sphinx-contrib/sphinx-lint). | ||
173 | |||
174 | To install sphinx-lint: | ||
175 | |||
176 | $ pip install sphinx-lint | ||
177 | |||
178 | To run sphinx-lint: | ||
179 | |||
180 | $ make sphinx-lint | ||
181 | |||
137 | Sphinx theme and CSS customization | 182 | Sphinx theme and CSS customization |
138 | ================================== | 183 | ================================== |
139 | 184 | ||
@@ -164,17 +209,18 @@ The layout of the Yocto Project manuals is organized as follows | |||
164 | Book | 209 | Book |
165 | Chapter | 210 | Chapter |
166 | Section | 211 | Section |
167 | Section | 212 | Subsection |
168 | Section | 213 | Subsubsection |
214 | Subsubsubsection | ||
169 | 215 | ||
170 | The following headings styles are defined in Sphinx: | 216 | Here are the heading styles that we use in the manuals: |
171 | 217 | ||
172 | Book => overline === | 218 | Book => overline === |
173 | Chapter => overline *** | 219 | Chapter => overline *** |
174 | Section => ==== | 220 | Section => ==== |
175 | Section => ---- | 221 | Subsection => ---- |
176 | Section => ^^^^ | 222 | Subsubsection => ~~~~ |
177 | Section => """" or ~~~~ | 223 | Subsubsubsection => ^^^^ |
178 | 224 | ||
179 | With this proposal, we preserve the same TOCs between Sphinx and Docbook. | 225 | With this proposal, we preserve the same TOCs between Sphinx and Docbook. |
180 | 226 | ||
@@ -185,7 +231,7 @@ Sphinx has a glossary directive. From | |||
185 | https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#glossary: | 231 | https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#glossary: |
186 | 232 | ||
187 | This directive must contain a reST definition list with terms and | 233 | This directive must contain a reST definition list with terms and |
188 | definitions. The definitions will then be referencable with the | 234 | definitions. It's then possible to refer to each definition through the |
189 | [https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-term | 235 | [https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-term |
190 | 'term' role]. | 236 | 'term' role]. |
191 | 237 | ||
@@ -206,7 +252,7 @@ however there are important shortcomings. For example they cannot be | |||
206 | used/nested inside code-block sections. | 252 | used/nested inside code-block sections. |
207 | 253 | ||
208 | A Sphinx extension was implemented to support variable substitutions | 254 | A Sphinx extension was implemented to support variable substitutions |
209 | to mimic the DocBook based documentation behavior. Variabes | 255 | to mimic the DocBook based documentation behavior. Variable |
210 | substitutions are done while reading/parsing the .rst files. The | 256 | substitutions are done while reading/parsing the .rst files. The |
211 | pattern for variables substitutions is the same as with DocBook, | 257 | pattern for variables substitutions is the same as with DocBook, |
212 | e.g. `&VAR;`. | 258 | e.g. `&VAR;`. |
@@ -222,7 +268,7 @@ For example, the following .rst content will produce the 'expected' | |||
222 | content: | 268 | content: |
223 | 269 | ||
224 | .. code-block:: | 270 | .. code-block:: |
225 | $ mkdir ~/poky-&DISTRO; | 271 | $ mkdir poky-&DISTRO; |
226 | or | 272 | or |
227 | $ git clone &YOCTO_GIT_URL;/git/poky -b &DISTRO_NAME_NO_CAP; | 273 | $ git clone &YOCTO_GIT_URL;/git/poky -b &DISTRO_NAME_NO_CAP; |
228 | 274 | ||
@@ -237,14 +283,14 @@ Note directive | |||
237 | Sphinx has a builtin 'note' directive that produces clean Note section | 283 | Sphinx has a builtin 'note' directive that produces clean Note section |
238 | in the output file. There are various types of directives such as | 284 | in the output file. There are various types of directives such as |
239 | "attention", "caution", "danger", "error", "hint", "important", "tip", | 285 | "attention", "caution", "danger", "error", "hint", "important", "tip", |
240 | "warning", "admonition" that are supported, and additional directive | 286 | "warning", "admonition" that are supported, and additional directives |
241 | can be added as Sphinx extension if needed. | 287 | can be added as Sphinx extension if needed. |
242 | 288 | ||
243 | Figures | 289 | Figures |
244 | ======= | 290 | ======= |
245 | 291 | ||
246 | The Yocto Project documentation has many figures/images. Sphinx has a | 292 | The Yocto Project documentation has many figures/images. Sphinx has a |
247 | 'figure' directive which is straight forward to use. To include a | 293 | 'figure' directive which is straightforward to use. To include a |
248 | figure in the body of the documentation: | 294 | figure in the body of the documentation: |
249 | 295 | ||
250 | .. image:: figures/YP-flow-diagram.png | 296 | .. image:: figures/YP-flow-diagram.png |
@@ -259,10 +305,26 @@ websites. | |||
259 | More information can be found here: | 305 | More information can be found here: |
260 | https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html. | 306 | https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html. |
261 | 307 | ||
308 | For external links, we use this syntax: | ||
309 | `link text <link URL>`__ | ||
310 | |||
311 | instead of: | ||
312 | `link text <link URL>`_ | ||
313 | |||
314 | Both syntaxes work, but the latter also creates a "link text" reference | ||
315 | target which could conflict with other references with the same name. | ||
316 | So, only use this variant when you wish to make multiple references | ||
317 | to this link, reusing only the target name. | ||
318 | |||
319 | See https://stackoverflow.com/questions/27420317/restructured-text-rst-http-links-underscore-vs-use | ||
320 | |||
321 | Anchor (<#link>) links are forbidden as they are not checked by Sphinx during | ||
322 | the build and may be broken without knowing about it. | ||
323 | |||
262 | References | 324 | References |
263 | ========== | 325 | ========== |
264 | 326 | ||
265 | The following extension is enabed by default: | 327 | The following extension is enabled by default: |
266 | sphinx.ext.autosectionlabel | 328 | sphinx.ext.autosectionlabel |
267 | (https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html). | 329 | (https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html). |
268 | 330 | ||
@@ -271,7 +333,7 @@ autosectionlabel_prefix_document is enabled by default, so that we can | |||
271 | insert references from any document. | 333 | insert references from any document. |
272 | 334 | ||
273 | For example, to insert an HTML link to a section from | 335 | For example, to insert an HTML link to a section from |
274 | documentaion/manual/intro.rst, use: | 336 | documentation/manual/intro.rst, use: |
275 | 337 | ||
276 | Please check this :ref:`manual/intro:Cross-References to Locations in the Same Document` | 338 | Please check this :ref:`manual/intro:Cross-References to Locations in the Same Document` |
277 | 339 | ||
@@ -294,7 +356,8 @@ Extlinks | |||
294 | 356 | ||
295 | The sphinx.ext.extlinks extension is enabled by default | 357 | The sphinx.ext.extlinks extension is enabled by default |
296 | (https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#use-the-external-links-extension), | 358 | (https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#use-the-external-links-extension), |
297 | and it is configured with: | 359 | and it is configured with the 'extlinks' definitions in |
360 | the 'documentation/conf.py' file: | ||
298 | 361 | ||
299 | 'yocto_home': ('https://yoctoproject.org%s', None), | 362 | 'yocto_home': ('https://yoctoproject.org%s', None), |
300 | 'yocto_wiki': ('https://wiki.yoctoproject.org%s', None), | 363 | 'yocto_wiki': ('https://wiki.yoctoproject.org%s', None), |
@@ -306,6 +369,10 @@ and it is configured with: | |||
306 | 'yocto_git': ('https://git.yoctoproject.org%s', None), | 369 | 'yocto_git': ('https://git.yoctoproject.org%s', None), |
307 | 'oe_home': ('https://www.openembedded.org%s', None), | 370 | 'oe_home': ('https://www.openembedded.org%s', None), |
308 | 'oe_lists': ('https://lists.openembedded.org%s', None), | 371 | 'oe_lists': ('https://lists.openembedded.org%s', None), |
372 | 'oe_git': ('https://git.openembedded.org%s', None), | ||
373 | 'oe_wiki': ('https://www.openembedded.org/wiki%s', None), | ||
374 | 'oe_layerindex': ('https://layers.openembedded.org%s', None), | ||
375 | 'oe_layer': ('https://layers.openembedded.org/layerindex/branch/master/layer%s', None), | ||
309 | 376 | ||
310 | It creates convenient shortcuts which can be used throughout the | 377 | It creates convenient shortcuts which can be used throughout the |
311 | documentation rst files, as: | 378 | documentation rst files, as: |
@@ -320,12 +387,29 @@ The sphinx.ext.intersphinx extension is enabled by default | |||
320 | so that we can cross reference content from other Sphinx based | 387 | so that we can cross reference content from other Sphinx based |
321 | documentation projects, such as the BitBake manual. | 388 | documentation projects, such as the BitBake manual. |
322 | 389 | ||
323 | References to the bitbake manual can be done like this: | 390 | References to the BitBake manual can directly be done: |
391 | - With a specific description instead of the section name: | ||
392 | :ref:`Azure Storage fetcher (az://) <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>` | ||
393 | - With the section name: | ||
394 | :ref:`bitbake-user-manual/bitbake-user-manual-intro:usage and syntax` option | ||
395 | |||
396 | If you want to refer to an entire document (or chapter) in the BitBake manual, | ||
397 | you have to use the ":doc:" macro with the "bitbake:" prefix: | ||
398 | - :doc:`BitBake User Manual <bitbake:index>` | ||
399 | - :doc:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata`" chapter | ||
400 | |||
401 | Note that a reference to a variable (:term:`VARIABLE`) automatically points to | ||
402 | the BitBake manual if the variable is not described in the Reference Manual's Variable Glossary. | ||
403 | However, if you need to bypass this, you can explicitely refer to a description in the | ||
404 | BitBake manual as follows: | ||
324 | 405 | ||
325 | See the ":ref:`-D <bitbake:bitbake-user-manual/bitbake-user-manual-intro:usage and syntax>`" option | ||
326 | or | ||
327 | :term:`bitbake:BB_NUMBER_PARSE_THREADS` | 406 | :term:`bitbake:BB_NUMBER_PARSE_THREADS` |
328 | 407 | ||
408 | This would be the same if we had identical document filenames in | ||
409 | both the Yocto Project and BitBake manuals: | ||
410 | |||
411 | :ref:`bitbake:directory/file:section title` | ||
412 | |||
329 | Submitting documentation changes | 413 | Submitting documentation changes |
330 | ================================ | 414 | ================================ |
331 | 415 | ||