doc: organize configuration sections better
Organize configuration sections per group (project, general, HTML, plugin options...). Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
0312b0ba7f
commit
603e875ab8
1 changed files with 59 additions and 65 deletions
124
doc/conf.py
124
doc/conf.py
|
@ -36,25 +36,7 @@ try:
|
|||
except ImportError:
|
||||
west_found = False
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
extensions = [
|
||||
'breathe', 'sphinx.ext.todo',
|
||||
'sphinx.ext.extlinks',
|
||||
'sphinx.ext.autodoc',
|
||||
'zephyr.application',
|
||||
'zephyr.html_redirects',
|
||||
'only.eager_only',
|
||||
'zephyr.dtcompatible-role',
|
||||
'zephyr.link-roles',
|
||||
'sphinx_tabs.tabs'
|
||||
]
|
||||
|
||||
# Only use SVG converter when it is really needed, e.g. LaTeX.
|
||||
if tags.has("svgconvert"): # pylint: disable=undefined-variable
|
||||
extensions.append('sphinxcontrib.rsvgconverter')
|
||||
|
||||
templates_path = ['_templates']
|
||||
# -- Project --------------------------------------------------------------
|
||||
|
||||
project = u'Zephyr Project'
|
||||
copyright = u'2015-2021 Zephyr Project members and individual contributors'
|
||||
|
@ -90,6 +72,26 @@ finally:
|
|||
sys.stderr.write('Warning: Could not extract kernel version\n')
|
||||
version = release = "unknown version"
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
extensions = [
|
||||
'breathe', 'sphinx.ext.todo',
|
||||
'sphinx.ext.extlinks',
|
||||
'sphinx.ext.autodoc',
|
||||
'zephyr.application',
|
||||
'zephyr.html_redirects',
|
||||
'only.eager_only',
|
||||
'zephyr.dtcompatible-role',
|
||||
'zephyr.link-roles',
|
||||
'sphinx_tabs.tabs'
|
||||
]
|
||||
|
||||
# Only use SVG converter when it is really needed, e.g. LaTeX.
|
||||
if tags.has("svgconvert"): # pylint: disable=undefined-variable
|
||||
extensions.append('sphinxcontrib.rsvgconverter')
|
||||
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
|
@ -128,65 +130,19 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
|||
html_theme_options = {
|
||||
'prev_next_buttons_location': None
|
||||
}
|
||||
|
||||
html_title = "Zephyr Project Documentation"
|
||||
|
||||
html_logo = 'images/Zephyr-Kite-logo.png'
|
||||
|
||||
html_favicon = 'images/zp_favicon.png'
|
||||
|
||||
html_static_path = ['{}/doc/_static'.format(ZEPHYR_BASE)]
|
||||
|
||||
html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
html_domain_indices = False
|
||||
|
||||
html_split_index = True
|
||||
|
||||
html_show_sourcelink = False
|
||||
|
||||
html_show_sphinx = False
|
||||
|
||||
html_search_scorer = '_static/js/scorer.js'
|
||||
|
||||
html_redirect_pages = redirects.REDIRECTS
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
'preamble': r'\setcounter{tocdepth}{2}',
|
||||
}
|
||||
|
||||
latex_documents = [
|
||||
('index', 'zephyr.tex', u'Zephyr Project Documentation',
|
||||
u'many', 'manual'),
|
||||
]
|
||||
|
||||
breathe_projects = {
|
||||
"Zephyr": "{}/doxygen/xml".format(ZEPHYR_BUILD),
|
||||
"doc-examples": "{}/doxygen/xml".format(ZEPHYR_BUILD)
|
||||
}
|
||||
breathe_default_project = "Zephyr"
|
||||
|
||||
breathe_domain_by_extension = {
|
||||
"h": "c",
|
||||
"c": "c",
|
||||
}
|
||||
breathe_separate_member_pages = True
|
||||
breathe_show_enumvalue_initializer = True
|
||||
|
||||
cpp_id_attributes = [
|
||||
'__syscall', '__deprecated', '__may_alias',
|
||||
'__used', '__unused', '__weak',
|
||||
'__DEPRECATED_MACRO', 'FUNC_NORETURN',
|
||||
'__subsystem',
|
||||
]
|
||||
c_id_attributes = cpp_id_attributes
|
||||
|
||||
# docs_title is used in the breadcrumb title in the zephyr docs theme
|
||||
is_release = tags.has('release') # pylint: disable=undefined-variable
|
||||
docs_title = 'Docs / {}'.format(version if is_release else 'Latest')
|
||||
|
||||
html_context = {
|
||||
'show_license': True,
|
||||
'docs_title': docs_title,
|
||||
|
@ -202,6 +158,44 @@ html_context = {
|
|||
)
|
||||
}
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
'preamble': r'\setcounter{tocdepth}{2}',
|
||||
}
|
||||
|
||||
latex_documents = [
|
||||
('index', 'zephyr.tex', u'Zephyr Project Documentation',
|
||||
u'many', 'manual'),
|
||||
]
|
||||
|
||||
# -- Options for Breathe plugin -------------------------------------------
|
||||
|
||||
breathe_projects = {
|
||||
"Zephyr": "{}/doxygen/xml".format(ZEPHYR_BUILD),
|
||||
"doc-examples": "{}/doxygen/xml".format(ZEPHYR_BUILD)
|
||||
}
|
||||
breathe_default_project = "Zephyr"
|
||||
breathe_domain_by_extension = {
|
||||
"h": "c",
|
||||
"c": "c",
|
||||
}
|
||||
breathe_separate_member_pages = True
|
||||
breathe_show_enumvalue_initializer = True
|
||||
|
||||
cpp_id_attributes = [
|
||||
'__syscall', '__deprecated', '__may_alias',
|
||||
'__used', '__unused', '__weak',
|
||||
'__DEPRECATED_MACRO', 'FUNC_NORETURN',
|
||||
'__subsystem',
|
||||
]
|
||||
c_id_attributes = cpp_id_attributes
|
||||
|
||||
# -- Options for html_redirect plugin -------------------------------------
|
||||
|
||||
html_redirect_pages = redirects.REDIRECTS
|
||||
|
||||
# -- Linkcheck options ----------------------------------------------------
|
||||
|
||||
extlinks = {'jira': ('https://jira.zephyrproject.org/browse/%s', ''),
|
||||
'github': ('https://github.com/zephyrproject-rtos/zephyr/issues/%s', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue