diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-07 12:44:48 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-17 10:09:34 +0100 |
| commit | ad2e3e614696e098cb4ab1791cb402adaa16d033 (patch) | |
| tree | 4f569bf5a63f66797c5ffb1bcd21e0f1894de377 /documentation/conf.py | |
| parent | 721edcfd44a61c4ea7a88d4e46d35bbdbce99c56 (diff) | |
| download | poky-ad2e3e614696e098cb4ab1791cb402adaa16d033.tar.gz | |
sphinx: Add support for multiple docs version
Enhance the sphinx experience/nagivation with:
* Remove the pointless looking parts of breadcrumb navigtation
* Add a document type switcher to the breadcrumb navigation
* Add a version selection switch to the breadcrumb navigation
(From yocto-docs rev: 1823624bdb9ea002d44c9e6d0fd4cd662bff36ad)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/conf.py')
| -rw-r--r-- | documentation/conf.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/documentation/conf.py b/documentation/conf.py index 546ca723a9..66af9fa060 100644 --- a/documentation/conf.py +++ b/documentation/conf.py | |||
| @@ -12,18 +12,25 @@ | |||
| 12 | # add these directories to sys.path here. If the directory is relative to the | 12 | # add these directories to sys.path here. If the directory is relative to the |
| 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. | 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 14 | # | 14 | # |
| 15 | # import os | 15 | import os |
| 16 | # import sys | 16 | import sys |
| 17 | # sys.path.insert(0, os.path.abspath('.')) | ||
| 18 | |||
| 19 | import datetime | 17 | import datetime |
| 20 | 18 | ||
| 19 | current_version = "dev" | ||
| 20 | |||
| 21 | # String used in sidebar | ||
| 22 | version = 'Version: ' + current_version | ||
| 23 | if current_version == 'dev': | ||
| 24 | version = 'Version: Current Development' | ||
| 25 | # Version seen in documentation_options.js and hence in js switchers code | ||
| 26 | release = current_version | ||
| 27 | |||
| 28 | |||
| 21 | # -- Project information ----------------------------------------------------- | 29 | # -- Project information ----------------------------------------------------- |
| 22 | project = 'The Yocto Project' | 30 | project = 'The Yocto Project' |
| 23 | copyright = '2010-%s, The Linux Foundation' % datetime.datetime.now().year | 31 | copyright = '2010-%s, The Linux Foundation' % datetime.datetime.now().year |
| 24 | author = 'The Linux Foundation' | 32 | author = 'The Linux Foundation' |
| 25 | 33 | ||
| 26 | |||
| 27 | # -- General configuration --------------------------------------------------- | 34 | # -- General configuration --------------------------------------------------- |
| 28 | 35 | ||
| 29 | # to load local extension from the folder 'sphinx' | 36 | # to load local extension from the folder 'sphinx' |
| @@ -96,4 +103,5 @@ html_context = { | |||
| 96 | 'css_files': [ | 103 | 'css_files': [ |
| 97 | '_static/theme_overrides.css', | 104 | '_static/theme_overrides.css', |
| 98 | ], | 105 | ], |
| 106 | 'current_version': current_version, | ||
| 99 | } | 107 | } |
