Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 1 | # Configuration file for the Sphinx documentation builder. |
| 2 | # |
| 3 | # This file only contains a selection of the most common options. For a full |
| 4 | # list see the documentation: |
| 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 | |
| 7 | # -- Path setup -------------------------------------------------------------- |
| 8 | |
| 9 | # If extensions (or modules to document with autodoc) are in another directory, |
| 10 | # add these directories to sys.path here. If the directory is relative to the |
| 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 12 | # |
| 13 | # import os |
| 14 | # import sys |
| 15 | # sys.path.insert(0, os.path.abspath('.')) |
| 16 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 17 | import sys |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 18 | import datetime |
| 19 | |
| 20 | current_version = "dev" |
| 21 | |
| 22 | # String used in sidebar |
| 23 | version = 'Version: ' + current_version |
| 24 | if current_version == 'dev': |
| 25 | version = 'Version: Current Development' |
| 26 | # Version seen in documentation_options.js and hence in js switchers code |
| 27 | release = current_version |
| 28 | |
| 29 | # -- Project information ----------------------------------------------------- |
| 30 | |
| 31 | project = 'Bitbake' |
| 32 | copyright = '2004-%s, Richard Purdie, Chris Larson, and Phil Blundell' \ |
| 33 | % datetime.datetime.now().year |
| 34 | author = 'Richard Purdie, Chris Larson, and Phil Blundell' |
| 35 | |
| 36 | # external links and substitutions |
| 37 | extlinks = { |
| 38 | 'yocto_docs': ('https://docs.yoctoproject.org%s', None), |
| 39 | 'oe_lists': ('https://lists.openembedded.org%s', None), |
| 40 | } |
| 41 | |
| 42 | # -- General configuration --------------------------------------------------- |
| 43 | |
| 44 | # Add any Sphinx extension module names here, as strings. They can be |
| 45 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 46 | # ones. |
| 47 | extensions = [ |
| 48 | 'sphinx.ext.autosectionlabel', |
| 49 | 'sphinx.ext.extlinks', |
| 50 | ] |
| 51 | autosectionlabel_prefix_document = True |
| 52 | |
| 53 | # Add any paths that contain templates here, relative to this directory. |
| 54 | templates_path = ['_templates'] |
| 55 | |
| 56 | # List of patterns, relative to source directory, that match files and |
| 57 | # directories to ignore when looking for source files. |
| 58 | # This pattern also affects html_static_path and html_extra_path. |
| 59 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 60 | |
| 61 | # master document name. The default changed from contents to index. so better |
| 62 | # set it ourselves. |
| 63 | master_doc = 'index' |
| 64 | |
| 65 | # create substitution for project configuration variables |
| 66 | rst_prolog = """ |
| 67 | .. |project_name| replace:: %s |
| 68 | .. |copyright| replace:: %s |
| 69 | .. |author| replace:: %s |
| 70 | """ % (project, copyright, author) |
| 71 | |
| 72 | # -- Options for HTML output ------------------------------------------------- |
| 73 | |
| 74 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 75 | # a list of builtin themes. |
| 76 | # |
Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 77 | try: |
| 78 | import sphinx_rtd_theme |
| 79 | html_theme = 'sphinx_rtd_theme' |
| 80 | except ImportError: |
| 81 | sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\ |
| 82 | \nPlease make sure to install the sphinx_rtd_theme python package.\n") |
| 83 | sys.exit(1) |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 84 | |
| 85 | # Add any paths that contain custom static files (such as style sheets) here, |
| 86 | # relative to this directory. They are copied after the builtin static files, |
| 87 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 88 | html_static_path = ['sphinx-static'] |
| 89 | |
| 90 | # Add customm CSS and JS files |
| 91 | html_css_files = ['theme_overrides.css'] |
| 92 | html_js_files = ['switchers.js'] |
| 93 | |
| 94 | # Hide 'Created using Sphinx' text |
| 95 | html_show_sphinx = False |
| 96 | |
| 97 | # Add 'Last updated' on each page |
| 98 | html_last_updated_fmt = '%b %d, %Y' |
| 99 | |
| 100 | # Remove the trailing 'dot' in section numbers |
| 101 | html_secnumber_suffix = " " |