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