summaryrefslogtreecommitdiffstats
path: root/documentation/conf.py
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-11-20 20:17:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 10:55:00 +0000
commitfa0cb4d34b1073f215fa3c680f2316208739d53d (patch)
treeba89c1f4289fd6456af4409a6a19caf6548dfb9c /documentation/conf.py
parenta038e58f3cd82c56102444bdc5ac76c9f1550a0d (diff)
downloadpoky-fa0cb4d34b1073f215fa3c680f2316208739d53d.tar.gz
sphinx: import docs
The Yocto Project docs was migrated from Docbook to Sphinx in YP 3.2. This 3.1 is an LTS release, and since 3.1 docs are 'close to' the docs in 3.2, we agreed to backport sphinx docs onto 3.1. This first patch brings all changes done in 3.2 until: 7f64574f7 README: include detailed information about sphinx There are other changes after this commit, but they will be selectively backported in individual patches. This patch was generated with the following command: git cherry-pick -n \ $(git log --reverse --oneline \ ac352ad7f95db7eeacb53c2778caa31800bd7c26..7f64574f7 \ | cut -f1 -d' ') The following commits were applies in the dunfell docs, but not in master, so they were first reverted (and squashed into this change). A commit will reintroduce the content from these patches in the Sphinx files in a followup patch. 069c27574 Documenation: Prepared for the 3.1.1 release bd140f0f9 Documentation: Add 3.1.1 version updates missing from previous commit 17cc71a8f Documenation: Prepared for the 3.1.2 release 1a69e2c02 Documenation: Prepared for the 3.1.3 release 8910ac1c7 Documenation: Prepared for the 3.1.4 release (From yocto-docs rev: c25fe058b88b893b0d146f3ed27320b47cdec236) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/conf.py')
-rw-r--r--documentation/conf.py127
1 files changed, 127 insertions, 0 deletions
diff --git a/documentation/conf.py b/documentation/conf.py
new file mode 100644
index 0000000000..f2dd2556fa
--- /dev/null
+++ b/documentation/conf.py
@@ -0,0 +1,127 @@
1# Configuration file for the Sphinx documentation builder.
2#
3# SPDX-License-Identifier: CC-BY-2.0-UK
4#
5# This file only contains a selection of the most common options. For a full
6# list see the documentation:
7# https://www.sphinx-doc.org/en/master/usage/configuration.html
8
9# -- Path setup --------------------------------------------------------------
10
11# If extensions (or modules to document with autodoc) are in another directory,
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.
14#
15import os
16import sys
17import datetime
18
19current_version = "dev"
20
21# String used in sidebar
22version = 'Version: ' + current_version
23if current_version == 'dev':
24 version = 'Version: Current Development'
25# Version seen in documentation_options.js and hence in js switchers code
26release = current_version
27
28
29# -- Project information -----------------------------------------------------
30project = 'The Yocto Project'
31copyright = '2010-%s, The Linux Foundation' % datetime.datetime.now().year
32author = 'The Linux Foundation'
33
34# -- General configuration ---------------------------------------------------
35
36# to load local extension from the folder 'sphinx'
37sys.path.insert(0, os.path.abspath('sphinx'))
38
39# Add any Sphinx extension module names here, as strings. They can be
40# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
41# ones.
42extensions = [
43 'sphinx.ext.autosectionlabel',
44 'sphinx.ext.extlinks',
45 'sphinx.ext.intersphinx',
46 'yocto-vars'
47]
48autosectionlabel_prefix_document = True
49
50# Add any paths that contain templates here, relative to this directory.
51templates_path = ['_templates']
52
53# List of patterns, relative to source directory, that match files and
54# directories to ignore when looking for source files.
55# This pattern also affects html_static_path and html_extra_path.
56exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'boilerplate.rst',
57 'adt-manual/*.rst']
58
59# master document name. The default changed from contents to index. so better
60# set it ourselves.
61master_doc = 'index'
62
63# create substitution for project configuration variables
64rst_prolog = """
65.. |project_name| replace:: %s
66.. |copyright| replace:: %s
67.. |author| replace:: %s
68""" % (project, copyright, author)
69
70# external links and substitutions
71extlinks = {
72 'yocto_home': ('https://yoctoproject.org%s', None),
73 'yocto_wiki': ('https://wiki.yoctoproject.org%s', None),
74 'yocto_dl': ('https://downloads.yoctoproject.org%s', None),
75 'yocto_lists': ('https://lists.yoctoproject.org%s', None),
76 'yocto_bugs': ('https://bugzilla.yoctoproject.org%s', None),
77 'yocto_ab': ('https://autobuilder.yoctoproject.org%s', None),
78 'yocto_docs': ('https://docs.yoctoproject.org%s', None),
79 'yocto_git': ('https://git.yoctoproject.org%s', None),
80 'oe_home': ('https://www.openembedded.org%s', None),
81 'oe_lists': ('https://lists.openembedded.org%s', None),
82}
83
84# Intersphinx config to use cross reference with Bitbake user manual
85intersphinx_mapping = {
86 'bitbake': ('https://docs.yoctoproject.org/bitbake/', None)
87}
88
89# -- Options for HTML output -------------------------------------------------
90
91# The theme to use for HTML and HTML Help pages. See the documentation for
92# a list of builtin themes.
93#
94try:
95 import sphinx_rtd_theme
96 html_theme = 'sphinx_rtd_theme'
97 html_theme_options = {
98 'sticky_navigation': False,
99 }
100except ImportError:
101 sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\
102 \nPlease make sure to install the sphinx_rtd_theme python package.\n")
103 sys.exit(1)
104
105html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg'
106
107# Add any paths that contain custom static files (such as style sheets) here,
108# relative to this directory. They are copied after the builtin static files,
109# so a file named "default.css" will overwrite the builtin "default.css".
110html_static_path = ['sphinx-static']
111
112html_context = {
113 'current_version': current_version,
114}
115
116# Add customm CSS and JS files
117html_css_files = ['theme_overrides.css']
118html_js_files = ['switchers.js']
119
120# Hide 'Created using Sphinx' text
121html_show_sphinx = False
122
123# Add 'Last updated' on each page
124html_last_updated_fmt = '%b %d, %Y'
125
126# Remove the trailing 'dot' in section numbers
127html_secnumber_suffix = " "