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 | |
| 17 | import datetime |
| 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 | # -- Project information ----------------------------------------------------- |
| 29 | |
| 30 | project = 'Bitbake' |
| 31 | copyright = '2004-%s, Richard Purdie, Chris Larson, and Phil Blundell' \ |
| 32 | % datetime.datetime.now().year |
| 33 | author = 'Richard Purdie, Chris Larson, and Phil Blundell' |
| 34 | |
| 35 | # external links and substitutions |
| 36 | extlinks = { |
| 37 | 'yocto_docs': ('https://docs.yoctoproject.org%s', None), |
| 38 | 'oe_lists': ('https://lists.openembedded.org%s', None), |
| 39 | } |
| 40 | |
| 41 | # -- General configuration --------------------------------------------------- |
| 42 | |
| 43 | # Add any Sphinx extension module names here, as strings. They can be |
| 44 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 45 | # ones. |
| 46 | extensions = [ |
| 47 | 'sphinx.ext.autosectionlabel', |
| 48 | 'sphinx.ext.extlinks', |
| 49 | ] |
| 50 | autosectionlabel_prefix_document = True |
| 51 | |
| 52 | # Add any paths that contain templates here, relative to this directory. |
| 53 | templates_path = ['_templates'] |
| 54 | |
| 55 | # List of patterns, relative to source directory, that match files and |
| 56 | # directories to ignore when looking for source files. |
| 57 | # This pattern also affects html_static_path and html_extra_path. |
| 58 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 59 | |
| 60 | # master document name. The default changed from contents to index. so better |
| 61 | # set it ourselves. |
| 62 | master_doc = 'index' |
| 63 | |
| 64 | # create substitution for project configuration variables |
| 65 | rst_prolog = """ |
| 66 | .. |project_name| replace:: %s |
| 67 | .. |copyright| replace:: %s |
| 68 | .. |author| replace:: %s |
| 69 | """ % (project, copyright, author) |
| 70 | |
| 71 | # -- Options for HTML output ------------------------------------------------- |
| 72 | |
| 73 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 74 | # a list of builtin themes. |
| 75 | # |
Andrew Geissler | af5e4ef | 2020-10-16 10:22:50 -0500 | [diff] [blame] | 76 | try: |
| 77 | import sphinx_rtd_theme |
| 78 | html_theme = 'sphinx_rtd_theme' |
| 79 | except ImportError: |
| 80 | sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\ |
| 81 | \nPlease make sure to install the sphinx_rtd_theme python package.\n") |
| 82 | sys.exit(1) |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 83 | |
| 84 | # Add any paths that contain custom static files (such as style sheets) here, |
| 85 | # relative to this directory. They are copied after the builtin static files, |
| 86 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 87 | html_static_path = ['sphinx-static'] |
| 88 | |
| 89 | # Add customm CSS and JS files |
| 90 | html_css_files = ['theme_overrides.css'] |
| 91 | html_js_files = ['switchers.js'] |
| 92 | |
| 93 | # Hide 'Created using Sphinx' text |
| 94 | html_show_sphinx = False |
| 95 | |
| 96 | # Add 'Last updated' on each page |
| 97 | html_last_updated_fmt = '%b %d, %Y' |
| 98 | |
| 99 | # Remove the trailing 'dot' in section numbers |
| 100 | html_secnumber_suffix = " " |