blob: b23ffefdc0d6b5e0f71d45314b9e33ab1828228a [file] [log] [blame]
Anas Nashif06d380c2015-05-13 14:05:30 -04001# -*- coding: utf-8 -*-
2#
Anas Nashif089a10b2015-06-12 10:51:09 -07003# Zephyr documentation build configuration file, created by
Anas Nashif06d380c2015-05-13 14:05:30 -04004# sphinx-quickstart on Fri May 8 11:43:01 2015.
5#
6# This file is execfile()d with the current directory set to its
7# containing dir.
8#
9# Note that not all possible configuration values are present in this
10# autogenerated file.
11#
12# All configuration values have a default; values that are commented out
13# serve to show the default.
14
15import sys
16import os
17import shlex
18
Marti Bolivar6092fb02017-11-03 16:46:33 -040019# Add the 'extensions' directory to sys.path, to enable finding Sphinx
20# extensions within.
21sys.path.insert(0, os.path.join(os.path.abspath('.'), 'extensions'))
Anas Nashif06d380c2015-05-13 14:05:30 -040022
23# -- General configuration ------------------------------------------------
24
25# If your documentation needs a minimal Sphinx version, state it here.
26#needs_sphinx = '1.0'
27
28# Add any Sphinx extension module names here, as strings. They can be
29# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30# ones.
31extensions = [
David B. Kinder05e00f62018-02-22 10:09:52 -080032 'breathe', 'sphinx.ext.todo',
Marti Bolivar6092fb02017-11-03 16:46:33 -040033 'sphinx.ext.extlinks',
34 'zephyr.application',
Anas Nashif06d380c2015-05-13 14:05:30 -040035]
36
37# Add any paths that contain templates here, relative to this directory.
38templates_path = ['_templates']
39
40# The suffix(es) of source filenames.
41# You can specify multiple suffix as a list of string:
42# source_suffix = ['.rst', '.md']
43source_suffix = '.rst'
44
45# The encoding of source files.
46#source_encoding = 'utf-8-sig'
47
48# The master toctree document.
49master_doc = 'index'
50
51# General information about the project.
Anas Nashif089a10b2015-06-12 10:51:09 -070052project = u'Zephyr Project'
Anas Nashif2131d172017-01-26 09:30:46 -050053copyright = u'2015-2017 Zephyr Project members and individual contributors.'
Anas Nashif06d380c2015-05-13 14:05:30 -040054author = u'many'
55
Anas Nashif75141782017-12-09 11:20:44 -050056if "ZEPHYR_BASE" not in os.environ:
57 sys.stderr.write("$ZEPHYR_BASE environment variable undefined.\n")
58 exit(1)
59ZEPHYR_BASE = os.environ["ZEPHYR_BASE"]
Anas Nashif762bd852016-12-23 12:25:06 -050060
61# The following code tries to extract the information by reading the Makefile,
62# when Sphinx is run directly (e.g. by Read the Docs).
63try:
Anas Nashifcb9390c2017-11-19 23:03:58 -050064 version_major = None
65 version_minor = None
66 patchlevel = None
67 extraversion = None
Anas Nashif75141782017-12-09 11:20:44 -050068 for line in open(os.path.join(ZEPHYR_BASE, 'VERSION')):
Anas Nashif762bd852016-12-23 12:25:06 -050069 key, val = [x.strip() for x in line.split('=', 2)]
70 if key == 'VERSION_MAJOR':
Anas Nashifcb9390c2017-11-19 23:03:58 -050071 version_major = val
Anas Nashif762bd852016-12-23 12:25:06 -050072 if key == 'VERSION_MINOR':
Anas Nashifcb9390c2017-11-19 23:03:58 -050073 version_minor = val
Anas Nashif762bd852016-12-23 12:25:06 -050074 elif key == 'PATCHLEVEL':
Anas Nashifcb9390c2017-11-19 23:03:58 -050075 patchlevel = val
76 elif key == 'EXTRAVERSION':
77 extraversion = val
78 if version_major and version_minor and patchlevel and extraversion:
Anas Nashif762bd852016-12-23 12:25:06 -050079 break
80except:
81 pass
82finally:
Anas Nashif75141782017-12-09 11:20:44 -050083 if version_major and version_minor and patchlevel and extraversion is not None :
Anas Nashifcb9390c2017-11-19 23:03:58 -050084 version = release = version_major + '.' + version_minor + '.' + patchlevel
85 if extraversion != '':
86 version = release = version + '-' + extraversion
Anas Nashif762bd852016-12-23 12:25:06 -050087 else:
88 sys.stderr.write('Warning: Could not extract kernel version\n')
89 version = release = "unknown version"
Anas Nashifa037c362017-11-07 20:02:24 -050090 version = release = os.getenv('KERNELVERSION','1.9.0')
Anas Nashif06d380c2015-05-13 14:05:30 -040091
92# The language for content autogenerated by Sphinx. Refer to documentation
93# for a list of supported languages.
94#
95# This is also used if you do content translation via gettext catalogs.
96# Usually you set "language" from the command line for these cases.
97language = None
98
99# There are two options for replacing |today|: either, you set today to some
100# non-false value, then it is used:
101#today = ''
102# Else, today_fmt is used as the format for a strftime call.
103#today_fmt = '%B %d, %Y'
104
105# List of patterns, relative to source directory, that match files and
106# directories to ignore when looking for source files.
107exclude_patterns = ['_build']
108
109# The reST default role (used for this markup: `text`) to use for all
110# documents.
111#default_role = None
112
113# If true, '()' will be appended to :func: etc. cross-reference text.
114#add_function_parentheses = True
115
116# If true, the current module name will be prepended to all description
117# unit titles (such as .. function::).
118#add_module_names = True
119
120# If true, sectionauthor and moduleauthor directives will be shown in the
121# output. They are ignored by default.
122#show_authors = False
123
124# The name of the Pygments (syntax highlighting) style to use.
125pygments_style = 'sphinx'
126
Bobby Noeltea5a29e42018-02-08 10:48:01 +0100127# Additional lexer for Pygments (syntax highlighting)
128from lexer.DtsLexer import DtsLexer
129from sphinx.highlighting import lexers
130lexers['DTS'] = DtsLexer()
131
Anas Nashif06d380c2015-05-13 14:05:30 -0400132# A list of ignored prefixes for module index sorting.
133#modindex_common_prefix = []
134
135# If true, keep warnings as "system message" paragraphs in the built documents.
136#keep_warnings = False
137
138# If true, `todo` and `todoList` produce output, else they produce nothing.
Carol Lee1aa77332015-08-07 13:22:27 -0400139todo_include_todos = False
Anas Nashif089a10b2015-06-12 10:51:09 -0700140
141rst_epilog = """
David B. Kinder486c5a52018-05-04 16:31:05 -0700142.. include:: /substitutions.txt
Anas Nashif089a10b2015-06-12 10:51:09 -0700143"""
Anas Nashif06d380c2015-05-13 14:05:30 -0400144
Anas Nashif06d380c2015-05-13 14:05:30 -0400145# -- Options for HTML output ----------------------------------------------
146
Anas Nashif9f52ee62016-12-23 12:27:57 -0500147try:
148 import sphinx_rtd_theme
149except ImportError:
150 html_theme = 'zephyr'
151 html_theme_path = ['./themes']
152else:
153 html_theme = "sphinx_rtd_theme"
154 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Anas Nashif06d380c2015-05-13 14:05:30 -0400155
Anas Nashif457ae382017-01-04 09:39:45 -0500156if tags.has('daily') or tags.has('release'):
157 html_theme = 'zephyr-docs-theme'
158 html_theme_path = ['./themes']
159
160
Anas Nashif3ba693f2017-05-19 08:36:20 -0400161if tags.has('release'):
Anas Nashifb53d6972017-11-17 19:02:11 -0500162 is_release = True
Anas Nashif3ba693f2017-05-19 08:36:20 -0400163 docs_title = 'Docs / %s' %(version)
164else:
Anas Nashifb53d6972017-11-17 19:02:11 -0500165 is_release = False
David B. Kinder5229f872018-03-02 14:01:52 -0800166 docs_title = 'Docs / Latest'
Anas Nashif3ba693f2017-05-19 08:36:20 -0400167
Anas Nashif06d380c2015-05-13 14:05:30 -0400168# The name for this set of Sphinx documents. If None, it defaults to
169# "<project> v<release> documentation".
Anas Nashif12867502015-06-29 15:33:28 -0400170html_title = "Zephyr Project Documentation"
Anas Nashif06d380c2015-05-13 14:05:30 -0400171
Yannis Damigosab1c6a12016-03-02 10:38:49 +0200172# This value determines the text for the permalink; it defaults to "¶".
173# Set it to None or the empty string to disable permalinks.
David B. Kinder4031da82017-02-06 09:51:15 -0800174#html_add_permalinks = ""
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500175
Anas Nashif06d380c2015-05-13 14:05:30 -0400176# A shorter title for the navigation bar. Default is the same as html_title.
177#html_short_title = None
178
179# The name of an image file (relative to this directory) to place at the top
180# of the sidebar.
181#html_logo = None
182
183# The name of an image file (within the static path) to use as favicon of the
184# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
185# pixels large.
186#html_favicon = None
187
188# Add any paths that contain custom static files (such as style sheets) here,
189# relative to this directory. They are copied after the builtin static files,
190# so a file named "default.css" will overwrite the builtin "default.css".
David B. Kinder6bd5dff2017-01-27 16:20:21 -0800191html_static_path = ['static']
Anas Nashif06d380c2015-05-13 14:05:30 -0400192
193# Add any extra paths that contain custom files (such as robots.txt or
194# .htaccess) here, relative to this directory. These files are copied
195# directly to the root of the documentation.
196#html_extra_path = []
197
198# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
199# using the given strftime format.
Anas Nashif5d91c932015-05-28 07:43:26 -0400200html_last_updated_fmt = '%b %d, %Y'
Anas Nashif06d380c2015-05-13 14:05:30 -0400201
202# If true, SmartyPants will be used to convert quotes and dashes to
203# typographically correct entities.
Carol Lee1aa77332015-08-07 13:22:27 -0400204#html_use_smartypants =
Anas Nashif06d380c2015-05-13 14:05:30 -0400205
206# Custom sidebar templates, maps document names to template names.
207#html_sidebars = {}
208
209# Additional templates that should be rendered to pages, maps page names to
210# template names.
211#html_additional_pages = {}
212
213# If false, no module index is generated.
Carol Lee1aa77332015-08-07 13:22:27 -0400214html_domain_indices = False
Anas Nashif06d380c2015-05-13 14:05:30 -0400215
216# If false, no index is generated.
Carol Lee1aa77332015-08-07 13:22:27 -0400217html_use_index = True
Anas Nashif06d380c2015-05-13 14:05:30 -0400218
219# If true, the index is split into individual pages for each letter.
Carol Lee1aa77332015-08-07 13:22:27 -0400220html_split_index = True
Anas Nashif06d380c2015-05-13 14:05:30 -0400221
222# If true, links to the reST sources are added to the pages.
Carol Lee1aa77332015-08-07 13:22:27 -0400223#html_show_sourcelink =
Anas Nashif06d380c2015-05-13 14:05:30 -0400224
225# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500226html_show_sphinx = False
Anas Nashif06d380c2015-05-13 14:05:30 -0400227
228# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
Anas Nashif457ae382017-01-04 09:39:45 -0500229html_show_copyright = tags.has('development')
Anas Nashif06d380c2015-05-13 14:05:30 -0400230
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500231# If true, license is shown in the HTML footer. Default is True.
232html_show_license = True
233
Anas Nashif06d380c2015-05-13 14:05:30 -0400234# If true, an OpenSearch description file will be output, and all pages will
235# contain a <link> tag referring to it. The value of this option must be the
236# base URL from which the finished HTML is served.
237#html_use_opensearch = ''
238
239# This is the file name suffix for HTML files (e.g. ".xhtml").
240#html_file_suffix = None
241
242# Language to be used for generating the HTML full-text search index.
243# Sphinx supports the following languages:
244# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
245# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
246#html_search_language = 'en'
247
David B. Kinder8875a982017-08-22 12:29:10 -0700248sourcelink_suffix = '.txt'
249
Anas Nashif06d380c2015-05-13 14:05:30 -0400250# A dictionary with options for the search language support, empty by default.
251# Now only 'ja' uses this config value
252#html_search_options = {'type': 'default'}
253
254# The name of a javascript file (relative to the configuration directory) that
255# implements a search results scorer. If empty, the default will be used.
256#html_search_scorer = 'scorer.js'
257
258# Output file base name for HTML help builder.
Anas Nashif089a10b2015-06-12 10:51:09 -0700259htmlhelp_basename = 'zephyrdoc'
Anas Nashif06d380c2015-05-13 14:05:30 -0400260
261# -- Options for LaTeX output ---------------------------------------------
262
263latex_elements = {
264# The paper size ('letterpaper' or 'a4paper').
265#'papersize': 'letterpaper',
266
267# The font size ('10pt', '11pt' or '12pt').
268#'pointsize': '10pt',
269
270# Additional stuff for the LaTeX preamble.
271#'preamble': '',
272
273# Latex figure (float) alignment
274#'figure_align': 'htbp',
275}
276
277# Grouping the document tree into LaTeX files. List of tuples
278# (source start file, target name, title,
279# author, documentclass [howto, manual, or own class]).
280latex_documents = [
Anas Nashif089a10b2015-06-12 10:51:09 -0700281 (master_doc, 'zephyr.tex', u'Zephyr Project Documentation',
Anas Nashif06d380c2015-05-13 14:05:30 -0400282 u'many', 'manual'),
283]
284
285# The name of an image file (relative to this directory) to place at the top of
286# the title page.
287#latex_logo = None
288
289# For "manual" documents, if this is true, then toplevel headings are parts,
290# not chapters.
291#latex_use_parts = False
292
293# If true, show page references after internal links.
294#latex_show_pagerefs = False
295
296# If true, show URL addresses after external links.
297#latex_show_urls = False
298
299# Documents to append as an appendix to all manuals.
300#latex_appendices = []
301
302# If false, no module index is generated.
303#latex_domain_indices = True
304
305
306# -- Options for manual page output ---------------------------------------
307
308# One entry per manual page. List of tuples
309# (source start file, name, description, authors, manual section).
310man_pages = [
Anas Nashif089a10b2015-06-12 10:51:09 -0700311 (master_doc, 'zephyr', u'Zephyr Project Documentation',
Anas Nashif06d380c2015-05-13 14:05:30 -0400312 [author], 1)
313]
314
315# If true, show URL addresses after external links.
316#man_show_urls = False
317
318
319# -- Options for Texinfo output -------------------------------------------
320
321# Grouping the document tree into Texinfo files. List of tuples
322# (source start file, target name, title, author,
323# dir menu entry, description, category)
324texinfo_documents = [
Anas Nashif089a10b2015-06-12 10:51:09 -0700325 (master_doc, 'zephyr', u'Zephyr Project Documentation',
326 author, 'Zephyr', 'One line description of project.',
Anas Nashif06d380c2015-05-13 14:05:30 -0400327 'Miscellaneous'),
328]
329
330# Documents to append as an appendix to all manuals.
331#texinfo_appendices = []
332
333# If false, no module index is generated.
334#texinfo_domain_indices = True
335
336# How to display URL addresses: 'footnote', 'no', or 'inline'.
337#texinfo_show_urls = 'footnote'
338
339# If true, do not generate a @detailmenu in the "Top" node's menu.
340#texinfo_no_detailmenu = False
341
Rodrigo Caballeroc394b342015-05-15 11:35:25 -0500342breathe_projects = {
Anas Nashif1fdfc5d2017-02-05 09:24:50 -0500343 "Zephyr": "doxygen/xml",
344 "doc-examples": "doxygen/xml"
Anas Nashif06d380c2015-05-13 14:05:30 -0400345}
Anas Nashif089a10b2015-06-12 10:51:09 -0700346breathe_default_project = "Zephyr"
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500347
David B. Kinder3d4f2132017-09-29 11:31:46 -0700348# Qualifiers to a function are causing Sphihx/Breathe to warn about
349# Error when parsing function declaration and more. This is a list
350# of strings that the parser additionally should accept as
351# attributes.
David B. Kinderde85fde2017-09-29 15:34:48 -0700352cpp_id_attributes = ['__syscall', '__syscall_inline', '__deprecated',
353 '__may_alias', '__used', '__unused', '__weak',
354 '__DEPRECATED_MACRO', 'FUNC_NORETURN' ]
David B. Kinder3d4f2132017-09-29 11:31:46 -0700355
David B. Kinder11baf5c2017-05-18 12:34:46 -0700356# docs_title is used in the breadcrumb title in the zephyr docs theme
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500357html_context = {
358 'show_license': html_show_license,
Anas Nashif3ba693f2017-05-19 08:36:20 -0400359 'docs_title': docs_title,
Anas Nashifb53d6972017-11-17 19:02:11 -0500360 'is_release': is_release,
Rodrigo Caballero8d7b52f2015-10-16 09:30:15 -0500361}
Anas Nashifb7b23182017-01-03 14:43:02 -0500362
David B. Kinder3d4f2132017-09-29 11:31:46 -0700363extlinks = {'jira': ('https://jira.zephyrproject.org/browse/%s', ''),
364 'github': ('https://github.com/zephyrproject-rtos/zephyr/issues/%s', '')
365 }
David B. Kinder6bd5dff2017-01-27 16:20:21 -0800366
David B. Kinder2a1adfc2017-04-27 14:59:04 -0700367# some configuration for linkcheck builder
368# noticed that we're getting false-positive link errors on JIRA, I suspect
369# because it's taking too long for the server to respond so bump up the
370# timeout (default=5) and turn off anchor checks (so only a HEAD request is
371# done - much faster) Leave the ignore commented in case we want to remove
372# jira link checks later...
373
374linkcheck_timeout = 30
375linkcheck_workers = 10
376# linkcheck_ignore = [r'https://jira\.zephyrproject\.org/']
377linkcheck_anchors = False
378
David B. Kinder6bd5dff2017-01-27 16:20:21 -0800379def setup(app):
380 app.add_stylesheet("zephyr-custom.css")