2015-05-14 02:05:30 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
2015-06-13 01:51:09 +08:00
|
|
|
# Zephyr documentation build configuration file, created by
|
2015-05-14 02:05:30 +08:00
|
|
|
# sphinx-quickstart on Fri May 8 11:43:01 2015.
|
|
|
|
#
|
|
|
|
# This file is execfile()d with the current directory set to its
|
|
|
|
# containing dir.
|
|
|
|
#
|
|
|
|
# Note that not all possible configuration values are present in this
|
|
|
|
# autogenerated file.
|
|
|
|
#
|
|
|
|
# All configuration values have a default; values that are commented out
|
|
|
|
# serve to show the default.
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import shlex
|
|
|
|
|
doc: add zephyr-app-commands directive
Add extensions/zephyr to the documentation. This is where Sphinx
extensions customized for Zephyr will live.
Within, add application.py. This provides a directive,
zephyr-app-commands, which generates commands in the docs to build,
flash, debug, etc. an application. For now, these are Unix shell
specific. Later on, they can be customized to generate additional
formats, perhaps with extra options.
After this is used throughout the tree, doing this with an extension
enables global changes with changes to the directive implementation
only.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-04 04:46:33 +08:00
|
|
|
# Add the 'extensions' directory to sys.path, to enable finding Sphinx
|
|
|
|
# extensions within.
|
|
|
|
sys.path.insert(0, os.path.join(os.path.abspath('.'), 'extensions'))
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# -- General configuration ------------------------------------------------
|
|
|
|
|
|
|
|
# If your documentation needs a minimal Sphinx version, state it here.
|
|
|
|
#needs_sphinx = '1.0'
|
|
|
|
|
|
|
|
# Add any Sphinx extension module names here, as strings. They can be
|
|
|
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
|
|
# ones.
|
|
|
|
extensions = [
|
2017-01-04 03:43:02 +08:00
|
|
|
'sphinx.ext.autodoc', 'breathe', 'sphinx.ext.todo',
|
doc: add zephyr-app-commands directive
Add extensions/zephyr to the documentation. This is where Sphinx
extensions customized for Zephyr will live.
Within, add application.py. This provides a directive,
zephyr-app-commands, which generates commands in the docs to build,
flash, debug, etc. an application. For now, these are Unix shell
specific. Later on, they can be customized to generate additional
formats, perhaps with extra options.
After this is used throughout the tree, doing this with an extension
enables global changes with changes to the directive implementation
only.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-04 04:46:33 +08:00
|
|
|
'sphinx.ext.extlinks',
|
|
|
|
'zephyr.application',
|
2015-05-14 02:05:30 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
# Add any paths that contain templates here, relative to this directory.
|
|
|
|
templates_path = ['_templates']
|
|
|
|
|
|
|
|
# The suffix(es) of source filenames.
|
|
|
|
# You can specify multiple suffix as a list of string:
|
|
|
|
# source_suffix = ['.rst', '.md']
|
|
|
|
source_suffix = '.rst'
|
|
|
|
|
|
|
|
# The encoding of source files.
|
|
|
|
#source_encoding = 'utf-8-sig'
|
|
|
|
|
|
|
|
# The master toctree document.
|
|
|
|
master_doc = 'index'
|
|
|
|
|
|
|
|
# General information about the project.
|
2015-06-13 01:51:09 +08:00
|
|
|
project = u'Zephyr Project'
|
2017-01-26 22:30:46 +08:00
|
|
|
copyright = u'2015-2017 Zephyr Project members and individual contributors.'
|
2015-05-14 02:05:30 +08:00
|
|
|
author = u'many'
|
|
|
|
|
2017-12-10 00:20:44 +08:00
|
|
|
if "ZEPHYR_BASE" not in os.environ:
|
|
|
|
sys.stderr.write("$ZEPHYR_BASE environment variable undefined.\n")
|
|
|
|
exit(1)
|
|
|
|
ZEPHYR_BASE = os.environ["ZEPHYR_BASE"]
|
2016-12-24 01:25:06 +08:00
|
|
|
|
|
|
|
# The following code tries to extract the information by reading the Makefile,
|
|
|
|
# when Sphinx is run directly (e.g. by Read the Docs).
|
|
|
|
try:
|
2017-11-20 12:03:58 +08:00
|
|
|
version_major = None
|
|
|
|
version_minor = None
|
|
|
|
patchlevel = None
|
|
|
|
extraversion = None
|
2017-12-10 00:20:44 +08:00
|
|
|
for line in open(os.path.join(ZEPHYR_BASE, 'VERSION')):
|
2016-12-24 01:25:06 +08:00
|
|
|
key, val = [x.strip() for x in line.split('=', 2)]
|
|
|
|
if key == 'VERSION_MAJOR':
|
2017-11-20 12:03:58 +08:00
|
|
|
version_major = val
|
2016-12-24 01:25:06 +08:00
|
|
|
if key == 'VERSION_MINOR':
|
2017-11-20 12:03:58 +08:00
|
|
|
version_minor = val
|
2016-12-24 01:25:06 +08:00
|
|
|
elif key == 'PATCHLEVEL':
|
2017-11-20 12:03:58 +08:00
|
|
|
patchlevel = val
|
|
|
|
elif key == 'EXTRAVERSION':
|
|
|
|
extraversion = val
|
|
|
|
if version_major and version_minor and patchlevel and extraversion:
|
2016-12-24 01:25:06 +08:00
|
|
|
break
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
finally:
|
2017-12-10 00:20:44 +08:00
|
|
|
if version_major and version_minor and patchlevel and extraversion is not None :
|
2017-11-20 12:03:58 +08:00
|
|
|
version = release = version_major + '.' + version_minor + '.' + patchlevel
|
|
|
|
if extraversion != '':
|
|
|
|
version = release = version + '-' + extraversion
|
2016-12-24 01:25:06 +08:00
|
|
|
else:
|
|
|
|
sys.stderr.write('Warning: Could not extract kernel version\n')
|
|
|
|
version = release = "unknown version"
|
2017-11-08 09:02:24 +08:00
|
|
|
version = release = os.getenv('KERNELVERSION','1.9.0')
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
|
|
# for a list of supported languages.
|
|
|
|
#
|
|
|
|
# This is also used if you do content translation via gettext catalogs.
|
|
|
|
# Usually you set "language" from the command line for these cases.
|
|
|
|
language = None
|
|
|
|
|
|
|
|
# There are two options for replacing |today|: either, you set today to some
|
|
|
|
# non-false value, then it is used:
|
|
|
|
#today = ''
|
|
|
|
# Else, today_fmt is used as the format for a strftime call.
|
|
|
|
#today_fmt = '%B %d, %Y'
|
|
|
|
|
|
|
|
# List of patterns, relative to source directory, that match files and
|
|
|
|
# directories to ignore when looking for source files.
|
|
|
|
exclude_patterns = ['_build']
|
|
|
|
|
|
|
|
# The reST default role (used for this markup: `text`) to use for all
|
|
|
|
# documents.
|
|
|
|
#default_role = None
|
|
|
|
|
|
|
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
|
|
|
#add_function_parentheses = True
|
|
|
|
|
|
|
|
# If true, the current module name will be prepended to all description
|
|
|
|
# unit titles (such as .. function::).
|
|
|
|
#add_module_names = True
|
|
|
|
|
|
|
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
|
|
|
# output. They are ignored by default.
|
|
|
|
#show_authors = False
|
|
|
|
|
|
|
|
# The name of the Pygments (syntax highlighting) style to use.
|
|
|
|
pygments_style = 'sphinx'
|
|
|
|
|
|
|
|
# A list of ignored prefixes for module index sorting.
|
|
|
|
#modindex_common_prefix = []
|
|
|
|
|
|
|
|
# If true, keep warnings as "system message" paragraphs in the built documents.
|
|
|
|
#keep_warnings = False
|
|
|
|
|
|
|
|
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
2015-08-08 01:22:27 +08:00
|
|
|
todo_include_todos = False
|
2015-06-13 01:51:09 +08:00
|
|
|
|
|
|
|
rst_epilog = """
|
2016-06-15 04:55:25 +08:00
|
|
|
.. |codename| replace:: Zephyr Kernel
|
|
|
|
.. |project| replace:: Zephyr Project
|
2017-04-05 06:46:21 +08:00
|
|
|
.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN
|
|
|
|
:ltrim:
|
|
|
|
.. |trade| unicode:: U+02122 .. TRADEMARK SIGN
|
|
|
|
:ltrim:
|
|
|
|
.. |reg| unicode:: U+000AE .. REGISTERED TRADEMARK SIGN
|
|
|
|
:ltrim:
|
2017-05-10 07:29:13 +08:00
|
|
|
.. |deg| unicode:: U+000B0 .. DEGREE SIGN
|
|
|
|
:ltrim:
|
|
|
|
.. |plusminus| unicode:: U+000B1 .. PLUS-MINUS SIGN
|
2017-06-16 07:34:08 +08:00
|
|
|
:rtrim:
|
2017-05-10 07:29:13 +08:00
|
|
|
.. |micro| unicode:: U+000B5 .. MICRO SIGN
|
2017-06-16 07:34:08 +08:00
|
|
|
:rtrim:
|
2015-06-13 01:51:09 +08:00
|
|
|
"""
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# -- Options for HTML output ----------------------------------------------
|
|
|
|
|
2016-12-24 01:27:57 +08:00
|
|
|
try:
|
|
|
|
import sphinx_rtd_theme
|
|
|
|
except ImportError:
|
|
|
|
html_theme = 'zephyr'
|
|
|
|
html_theme_path = ['./themes']
|
|
|
|
else:
|
|
|
|
html_theme = "sphinx_rtd_theme"
|
|
|
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
2015-05-14 02:05:30 +08:00
|
|
|
|
2017-01-04 22:39:45 +08:00
|
|
|
if tags.has('daily') or tags.has('release'):
|
|
|
|
html_theme = 'zephyr-docs-theme'
|
|
|
|
html_theme_path = ['./themes']
|
|
|
|
|
|
|
|
|
2017-05-19 20:36:20 +08:00
|
|
|
if tags.has('release'):
|
2017-11-18 08:02:11 +08:00
|
|
|
is_release = True
|
2017-05-19 20:36:20 +08:00
|
|
|
docs_title = 'Docs / %s' %(version)
|
|
|
|
else:
|
2017-11-18 08:02:11 +08:00
|
|
|
is_release = False
|
2017-05-19 20:36:20 +08:00
|
|
|
docs_title = 'Docs'
|
|
|
|
|
2015-05-14 02:05:30 +08:00
|
|
|
# The name for this set of Sphinx documents. If None, it defaults to
|
|
|
|
# "<project> v<release> documentation".
|
2015-06-30 03:33:28 +08:00
|
|
|
html_title = "Zephyr Project Documentation"
|
2015-05-14 02:05:30 +08:00
|
|
|
|
2016-03-02 16:38:49 +08:00
|
|
|
# This value determines the text for the permalink; it defaults to "¶".
|
|
|
|
# Set it to None or the empty string to disable permalinks.
|
2017-02-07 01:51:15 +08:00
|
|
|
#html_add_permalinks = ""
|
2015-10-16 22:30:15 +08:00
|
|
|
|
2015-05-14 02:05:30 +08:00
|
|
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
|
|
|
#html_short_title = None
|
|
|
|
|
|
|
|
# The name of an image file (relative to this directory) to place at the top
|
|
|
|
# of the sidebar.
|
|
|
|
#html_logo = None
|
|
|
|
|
|
|
|
# The name of an image file (within the static path) to use as favicon of the
|
|
|
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
|
|
|
# pixels large.
|
|
|
|
#html_favicon = None
|
|
|
|
|
|
|
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
|
|
# relative to this directory. They are copied after the builtin static files,
|
|
|
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
2017-01-28 08:20:21 +08:00
|
|
|
html_static_path = ['static']
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# Add any extra paths that contain custom files (such as robots.txt or
|
|
|
|
# .htaccess) here, relative to this directory. These files are copied
|
|
|
|
# directly to the root of the documentation.
|
|
|
|
#html_extra_path = []
|
|
|
|
|
|
|
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
|
|
|
# using the given strftime format.
|
2015-05-28 19:43:26 +08:00
|
|
|
html_last_updated_fmt = '%b %d, %Y'
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
|
|
|
# typographically correct entities.
|
2015-08-08 01:22:27 +08:00
|
|
|
#html_use_smartypants =
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# Custom sidebar templates, maps document names to template names.
|
|
|
|
#html_sidebars = {}
|
|
|
|
|
|
|
|
# Additional templates that should be rendered to pages, maps page names to
|
|
|
|
# template names.
|
|
|
|
#html_additional_pages = {}
|
|
|
|
|
|
|
|
# If false, no module index is generated.
|
2015-08-08 01:22:27 +08:00
|
|
|
html_domain_indices = False
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If false, no index is generated.
|
2015-08-08 01:22:27 +08:00
|
|
|
html_use_index = True
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If true, the index is split into individual pages for each letter.
|
2015-08-08 01:22:27 +08:00
|
|
|
html_split_index = True
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If true, links to the reST sources are added to the pages.
|
2015-08-08 01:22:27 +08:00
|
|
|
#html_show_sourcelink =
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
2015-10-16 22:30:15 +08:00
|
|
|
html_show_sphinx = False
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
2017-01-04 22:39:45 +08:00
|
|
|
html_show_copyright = tags.has('development')
|
2015-05-14 02:05:30 +08:00
|
|
|
|
2015-10-16 22:30:15 +08:00
|
|
|
# If true, license is shown in the HTML footer. Default is True.
|
|
|
|
html_show_license = True
|
|
|
|
|
2015-05-14 02:05:30 +08:00
|
|
|
# If true, an OpenSearch description file will be output, and all pages will
|
|
|
|
# contain a <link> tag referring to it. The value of this option must be the
|
|
|
|
# base URL from which the finished HTML is served.
|
|
|
|
#html_use_opensearch = ''
|
|
|
|
|
|
|
|
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
|
|
|
#html_file_suffix = None
|
|
|
|
|
|
|
|
# Language to be used for generating the HTML full-text search index.
|
|
|
|
# Sphinx supports the following languages:
|
|
|
|
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
|
|
|
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
|
|
|
|
#html_search_language = 'en'
|
|
|
|
|
2017-08-23 03:29:10 +08:00
|
|
|
sourcelink_suffix = '.txt'
|
|
|
|
|
2015-05-14 02:05:30 +08:00
|
|
|
# A dictionary with options for the search language support, empty by default.
|
|
|
|
# Now only 'ja' uses this config value
|
|
|
|
#html_search_options = {'type': 'default'}
|
|
|
|
|
|
|
|
# The name of a javascript file (relative to the configuration directory) that
|
|
|
|
# implements a search results scorer. If empty, the default will be used.
|
|
|
|
#html_search_scorer = 'scorer.js'
|
|
|
|
|
|
|
|
# Output file base name for HTML help builder.
|
2015-06-13 01:51:09 +08:00
|
|
|
htmlhelp_basename = 'zephyrdoc'
|
2015-05-14 02:05:30 +08:00
|
|
|
|
|
|
|
# -- Options for LaTeX output ---------------------------------------------
|
|
|
|
|
|
|
|
latex_elements = {
|
|
|
|
# The paper size ('letterpaper' or 'a4paper').
|
|
|
|
#'papersize': 'letterpaper',
|
|
|
|
|
|
|
|
# The font size ('10pt', '11pt' or '12pt').
|
|
|
|
#'pointsize': '10pt',
|
|
|
|
|
|
|
|
# Additional stuff for the LaTeX preamble.
|
|
|
|
#'preamble': '',
|
|
|
|
|
|
|
|
# Latex figure (float) alignment
|
|
|
|
#'figure_align': 'htbp',
|
|
|
|
}
|
|
|
|
|
|
|
|
# Grouping the document tree into LaTeX files. List of tuples
|
|
|
|
# (source start file, target name, title,
|
|
|
|
# author, documentclass [howto, manual, or own class]).
|
|
|
|
latex_documents = [
|
2015-06-13 01:51:09 +08:00
|
|
|
(master_doc, 'zephyr.tex', u'Zephyr Project Documentation',
|
2015-05-14 02:05:30 +08:00
|
|
|
u'many', 'manual'),
|
|
|
|
]
|
|
|
|
|
|
|
|
# The name of an image file (relative to this directory) to place at the top of
|
|
|
|
# the title page.
|
|
|
|
#latex_logo = None
|
|
|
|
|
|
|
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
|
|
# not chapters.
|
|
|
|
#latex_use_parts = False
|
|
|
|
|
|
|
|
# If true, show page references after internal links.
|
|
|
|
#latex_show_pagerefs = False
|
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
|
|
|
#latex_show_urls = False
|
|
|
|
|
|
|
|
# Documents to append as an appendix to all manuals.
|
|
|
|
#latex_appendices = []
|
|
|
|
|
|
|
|
# If false, no module index is generated.
|
|
|
|
#latex_domain_indices = True
|
|
|
|
|
|
|
|
|
|
|
|
# -- Options for manual page output ---------------------------------------
|
|
|
|
|
|
|
|
# One entry per manual page. List of tuples
|
|
|
|
# (source start file, name, description, authors, manual section).
|
|
|
|
man_pages = [
|
2015-06-13 01:51:09 +08:00
|
|
|
(master_doc, 'zephyr', u'Zephyr Project Documentation',
|
2015-05-14 02:05:30 +08:00
|
|
|
[author], 1)
|
|
|
|
]
|
|
|
|
|
|
|
|
# If true, show URL addresses after external links.
|
|
|
|
#man_show_urls = False
|
|
|
|
|
|
|
|
|
|
|
|
# -- Options for Texinfo output -------------------------------------------
|
|
|
|
|
|
|
|
# Grouping the document tree into Texinfo files. List of tuples
|
|
|
|
# (source start file, target name, title, author,
|
|
|
|
# dir menu entry, description, category)
|
|
|
|
texinfo_documents = [
|
2015-06-13 01:51:09 +08:00
|
|
|
(master_doc, 'zephyr', u'Zephyr Project Documentation',
|
|
|
|
author, 'Zephyr', 'One line description of project.',
|
2015-05-14 02:05:30 +08:00
|
|
|
'Miscellaneous'),
|
|
|
|
]
|
|
|
|
|
|
|
|
# Documents to append as an appendix to all manuals.
|
|
|
|
#texinfo_appendices = []
|
|
|
|
|
|
|
|
# If false, no module index is generated.
|
|
|
|
#texinfo_domain_indices = True
|
|
|
|
|
|
|
|
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
|
|
|
#texinfo_show_urls = 'footnote'
|
|
|
|
|
|
|
|
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
|
|
|
#texinfo_no_detailmenu = False
|
|
|
|
|
2015-05-16 00:35:25 +08:00
|
|
|
breathe_projects = {
|
2017-02-05 22:24:50 +08:00
|
|
|
"Zephyr": "doxygen/xml",
|
|
|
|
"doc-examples": "doxygen/xml"
|
2015-05-14 02:05:30 +08:00
|
|
|
}
|
2015-06-13 01:51:09 +08:00
|
|
|
breathe_default_project = "Zephyr"
|
2015-10-16 22:30:15 +08:00
|
|
|
|
2017-09-30 02:31:46 +08:00
|
|
|
# Qualifiers to a function are causing Sphihx/Breathe to warn about
|
|
|
|
# Error when parsing function declaration and more. This is a list
|
|
|
|
# of strings that the parser additionally should accept as
|
|
|
|
# attributes.
|
2017-09-30 06:34:48 +08:00
|
|
|
cpp_id_attributes = ['__syscall', '__syscall_inline', '__deprecated',
|
|
|
|
'__may_alias', '__used', '__unused', '__weak',
|
|
|
|
'__DEPRECATED_MACRO', 'FUNC_NORETURN' ]
|
2017-09-30 02:31:46 +08:00
|
|
|
|
2017-05-19 03:34:46 +08:00
|
|
|
# docs_title is used in the breadcrumb title in the zephyr docs theme
|
2015-10-16 22:30:15 +08:00
|
|
|
html_context = {
|
|
|
|
'show_license': html_show_license,
|
2017-05-19 20:36:20 +08:00
|
|
|
'docs_title': docs_title,
|
2017-11-18 08:02:11 +08:00
|
|
|
'is_release': is_release,
|
2015-10-16 22:30:15 +08:00
|
|
|
}
|
2017-01-04 03:43:02 +08:00
|
|
|
|
2017-09-30 02:31:46 +08:00
|
|
|
extlinks = {'jira': ('https://jira.zephyrproject.org/browse/%s', ''),
|
|
|
|
'github': ('https://github.com/zephyrproject-rtos/zephyr/issues/%s', '')
|
|
|
|
}
|
2017-01-28 08:20:21 +08:00
|
|
|
|
2017-04-28 05:59:04 +08:00
|
|
|
# some configuration for linkcheck builder
|
|
|
|
# noticed that we're getting false-positive link errors on JIRA, I suspect
|
|
|
|
# because it's taking too long for the server to respond so bump up the
|
|
|
|
# timeout (default=5) and turn off anchor checks (so only a HEAD request is
|
|
|
|
# done - much faster) Leave the ignore commented in case we want to remove
|
|
|
|
# jira link checks later...
|
|
|
|
|
|
|
|
linkcheck_timeout = 30
|
|
|
|
linkcheck_workers = 10
|
|
|
|
# linkcheck_ignore = [r'https://jira\.zephyrproject\.org/']
|
|
|
|
linkcheck_anchors = False
|
|
|
|
|
2017-01-28 08:20:21 +08:00
|
|
|
def setup(app):
|
|
|
|
app.add_stylesheet("zephyr-custom.css")
|