summaryrefslogtreecommitdiffstats
path: root/documentation/sphinx
Commit message (Collapse)AuthorAgeFilesLines
* docs: sphinx: yocto-vars: rebuild files when poky.yaml has changedQuentin Schulz2020-10-201-2/+41
| | | | | | | | | | | | | | | | poky.yaml changes aren't detected by Sphinx by default. In order to detect changes in poky.yaml, its md5sum is stored in the app.outdir (BUILDDIR/html when building html) and checked against the md5sum of the poky.yaml under use. If the md5sum has changed, find all rst files in app.srcdir that have at least an occurence of `&.*;` and mark them as requiring a rebuild. (From yocto-docs rev: 59537c7fa49e3ea6918f45b3201ad16d56988b9b) Signed-off-by: Quentin Schulz <foss@0leil.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sphinx: report errors when dependencies are not metNicolas Dechesne2020-09-221-1/+10
| | | | | | | | | | | | | | | | To build the Sphinx documentation, we have the following dependencies: * sphinx * sphinx_rtd_theme * pyyaml If any of these dependencies are missing, we might end up with some cryptic error messages. This patch adds better error reporting when dependencies are not met. (From yocto-docs rev: 19df8d1ec56dc2ecb44122288cc53e84237fab69) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sphinx: conf: add substitutions/global variablesNicolas Dechesne2020-09-171-0/+38
The Yocto Project documentation makes heavy use of 'global' variables. In Docbook these 'variables' are stored in the file poky.ent. This Docbook feature is not handled automatically with Pandoc. Sphinx has builtin support for substitutions however they are local to each reST file by default. They can be made global by using rst_prolog: rst_prolog A string of reStructuredText that will be included at the beginning of every source file that is read. However Sphinx substitution feature has several important limitations. For example, substitution does not work in code-block section. yocto-vars.py is an extension that processes .rst file to find and replace 'variables'. This plugin will do variables substitutions whenever a rst file is read, so it happens before sphinx parses the content. All variables are set in poky.yaml. It's a simple YAML file with pairs of variable/value, and the file is parsed once during setup. It's important to note that variables can reference other variables. poky.yaml was generated by converting poky.ent into a YAML format. To use a variable in the Yocto Project .rst files, make sure it is defined in poky.yaml, and then you can use : &DISTRO_NAME; For external links, Sphinx has a specific extension called extlinks, let's use it instead of variable substituions. Note that we intentionnally did not put the trailing '/' in the URL, this is to allow us to use :yocto_git:`/` trick to get the actual URL displayed in the HTML. (From yocto-docs rev: dc5f53fae8fdfdda04285869dd1419107b920bfe) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>