diff options
Diffstat (limited to 'documentation/conf.py')
-rw-r--r-- | documentation/conf.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/documentation/conf.py b/documentation/conf.py index c2e9801fd9..e9078e054e 100644 --- a/documentation/conf.py +++ b/documentation/conf.py | |||
@@ -15,8 +15,27 @@ | |||
15 | import os | 15 | import os |
16 | import sys | 16 | import sys |
17 | import datetime | 17 | import datetime |
18 | try: | ||
19 | import yaml | ||
20 | except ImportError: | ||
21 | sys.stderr.write("The Yocto Project Sphinx documentation requires PyYAML.\ | ||
22 | \nPlease make sure to install pyyaml python package.\n") | ||
23 | sys.exit(1) | ||
18 | 24 | ||
19 | current_version = "3.1.6" | 25 | # current_version = "dev" |
26 | # bitbake_version = "" # Leave empty for development branch | ||
27 | # Obtain versions from poky.yaml instead | ||
28 | with open("poky.yaml") as data: | ||
29 | buff = data.read() | ||
30 | subst_vars = yaml.safe_load(buff) | ||
31 | if "DOCCONF_VERSION" not in subst_vars: | ||
32 | sys.stderr.write("Please set DOCCONF_VERSION in poky.yaml") | ||
33 | sys.exit(1) | ||
34 | current_version = subst_vars["DOCCONF_VERSION"] | ||
35 | if "BITBAKE_SERIES" not in subst_vars: | ||
36 | sys.stderr.write("Please set BITBAKE_SERIES in poky.yaml") | ||
37 | sys.exit(1) | ||
38 | bitbake_version = subst_vars["BITBAKE_SERIES"] | ||
20 | 39 | ||
21 | # String used in sidebar | 40 | # String used in sidebar |
22 | version = 'Version: ' + current_version | 41 | version = 'Version: ' + current_version |
@@ -78,11 +97,12 @@ extlinks = { | |||
78 | 'yocto_git': ('https://git.yoctoproject.org%s', None), | 97 | 'yocto_git': ('https://git.yoctoproject.org%s', None), |
79 | 'oe_home': ('https://www.openembedded.org%s', None), | 98 | 'oe_home': ('https://www.openembedded.org%s', None), |
80 | 'oe_lists': ('https://lists.openembedded.org%s', None), | 99 | 'oe_lists': ('https://lists.openembedded.org%s', None), |
100 | 'oe_git': ('https://git.openembedded.org%s', None), | ||
81 | } | 101 | } |
82 | 102 | ||
83 | # Intersphinx config to use cross reference with Bitbake user manual | 103 | # Intersphinx config to use cross reference with Bitbake user manual |
84 | intersphinx_mapping = { | 104 | intersphinx_mapping = { |
85 | 'bitbake': ('https://docs.yoctoproject.org/bitbake/1.46', None) | 105 | 'bitbake': ('https://docs.yoctoproject.org/bitbake/' + bitbake_version, None) |
86 | } | 106 | } |
87 | 107 | ||
88 | # -- Options for HTML output ------------------------------------------------- | 108 | # -- Options for HTML output ------------------------------------------------- |