xref: /openbmc/linux/Documentation/conf.py (revision bc5aa3a0)
1# -*- coding: utf-8 -*-
2#
3# The Linux Kernel documentation build configuration file, created by
4# sphinx-quickstart on Fri Feb 12 13:51:46 2016.
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
17
18# If extensions (or modules to document with autodoc) are in another directory,
19# add these directories to sys.path here. If the directory is relative to the
20# documentation root, use os.path.abspath to make it absolute, like shown here.
21sys.path.insert(0, os.path.abspath('sphinx'))
22
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 = ['kernel-doc', 'rstFlatTable', 'kernel_include']
32
33# Gracefully handle missing rst2pdf.
34try:
35    import rst2pdf
36    extensions += ['rst2pdf.pdfbuilder']
37except ImportError:
38    pass
39
40# Add any paths that contain templates here, relative to this directory.
41templates_path = ['_templates']
42
43# The suffix(es) of source filenames.
44# You can specify multiple suffix as a list of string:
45# source_suffix = ['.rst', '.md']
46source_suffix = '.rst'
47
48# The encoding of source files.
49#source_encoding = 'utf-8-sig'
50
51# The master toctree document.
52master_doc = 'index'
53
54# General information about the project.
55project = 'The Linux Kernel'
56copyright = '2016, The kernel development community'
57author = 'The kernel development community'
58
59# The version info for the project you're documenting, acts as replacement for
60# |version| and |release|, also used in various other places throughout the
61# built documents.
62#
63# In a normal build, version and release are are set to KERNELVERSION and
64# KERNELRELEASE, respectively, from the Makefile via Sphinx command line
65# arguments.
66#
67# The following code tries to extract the information by reading the Makefile,
68# when Sphinx is run directly (e.g. by Read the Docs).
69try:
70    makefile_version = None
71    makefile_patchlevel = None
72    for line in open('../Makefile'):
73        key, val = [x.strip() for x in line.split('=', 2)]
74        if key == 'VERSION':
75            makefile_version = val
76        elif key == 'PATCHLEVEL':
77            makefile_patchlevel = val
78        if makefile_version and makefile_patchlevel:
79            break
80except:
81    pass
82finally:
83    if makefile_version and makefile_patchlevel:
84        version = release = makefile_version + '.' + makefile_patchlevel
85    else:
86        sys.stderr.write('Warning: Could not extract kernel version\n')
87        version = release = "unknown version"
88
89# The language for content autogenerated by Sphinx. Refer to documentation
90# for a list of supported languages.
91#
92# This is also used if you do content translation via gettext catalogs.
93# Usually you set "language" from the command line for these cases.
94language = None
95
96# There are two options for replacing |today|: either, you set today to some
97# non-false value, then it is used:
98#today = ''
99# Else, today_fmt is used as the format for a strftime call.
100#today_fmt = '%B %d, %Y'
101
102# List of patterns, relative to source directory, that match files and
103# directories to ignore when looking for source files.
104exclude_patterns = ['output']
105
106# The reST default role (used for this markup: `text`) to use for all
107# documents.
108#default_role = None
109
110# If true, '()' will be appended to :func: etc. cross-reference text.
111#add_function_parentheses = True
112
113# If true, the current module name will be prepended to all description
114# unit titles (such as .. function::).
115#add_module_names = True
116
117# If true, sectionauthor and moduleauthor directives will be shown in the
118# output. They are ignored by default.
119#show_authors = False
120
121# The name of the Pygments (syntax highlighting) style to use.
122pygments_style = 'sphinx'
123
124# A list of ignored prefixes for module index sorting.
125#modindex_common_prefix = []
126
127# If true, keep warnings as "system message" paragraphs in the built documents.
128#keep_warnings = False
129
130# If true, `todo` and `todoList` produce output, else they produce nothing.
131todo_include_todos = False
132
133primary_domain = 'C'
134highlight_language = 'guess'
135
136# -- Options for HTML output ----------------------------------------------
137
138# The theme to use for HTML and HTML Help pages.  See the documentation for
139# a list of builtin themes.
140
141# The Read the Docs theme is available from
142# - https://github.com/snide/sphinx_rtd_theme
143# - https://pypi.python.org/pypi/sphinx_rtd_theme
144# - python-sphinx-rtd-theme package (on Debian)
145try:
146    import sphinx_rtd_theme
147    html_theme = 'sphinx_rtd_theme'
148    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
149except ImportError:
150    sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')
151
152# Theme options are theme-specific and customize the look and feel of a theme
153# further.  For a list of options available for each theme, see the
154# documentation.
155#html_theme_options = {}
156
157# Add any paths that contain custom themes here, relative to this directory.
158#html_theme_path = []
159
160# The name for this set of Sphinx documents.  If None, it defaults to
161# "<project> v<release> documentation".
162#html_title = None
163
164# A shorter title for the navigation bar.  Default is the same as html_title.
165#html_short_title = None
166
167# The name of an image file (relative to this directory) to place at the top
168# of the sidebar.
169#html_logo = None
170
171# The name of an image file (within the static path) to use as favicon of the
172# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
173# pixels large.
174#html_favicon = None
175
176# Add any paths that contain custom static files (such as style sheets) here,
177# relative to this directory. They are copied after the builtin static files,
178# so a file named "default.css" will overwrite the builtin "default.css".
179
180html_static_path = ['sphinx-static']
181
182html_context = {
183    'css_files': [
184        '_static/theme_overrides.css',
185    ],
186}
187
188# Add any extra paths that contain custom files (such as robots.txt or
189# .htaccess) here, relative to this directory. These files are copied
190# directly to the root of the documentation.
191#html_extra_path = []
192
193# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
194# using the given strftime format.
195#html_last_updated_fmt = '%b %d, %Y'
196
197# If true, SmartyPants will be used to convert quotes and dashes to
198# typographically correct entities.
199#html_use_smartypants = True
200
201# Custom sidebar templates, maps document names to template names.
202#html_sidebars = {}
203
204# Additional templates that should be rendered to pages, maps page names to
205# template names.
206#html_additional_pages = {}
207
208# If false, no module index is generated.
209#html_domain_indices = True
210
211# If false, no index is generated.
212#html_use_index = True
213
214# If true, the index is split into individual pages for each letter.
215#html_split_index = False
216
217# If true, links to the reST sources are added to the pages.
218#html_show_sourcelink = True
219
220# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
221#html_show_sphinx = True
222
223# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
224#html_show_copyright = True
225
226# If true, an OpenSearch description file will be output, and all pages will
227# contain a <link> tag referring to it.  The value of this option must be the
228# base URL from which the finished HTML is served.
229#html_use_opensearch = ''
230
231# This is the file name suffix for HTML files (e.g. ".xhtml").
232#html_file_suffix = None
233
234# Language to be used for generating the HTML full-text search index.
235# Sphinx supports the following languages:
236#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
237#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
238#html_search_language = 'en'
239
240# A dictionary with options for the search language support, empty by default.
241# Now only 'ja' uses this config value
242#html_search_options = {'type': 'default'}
243
244# The name of a javascript file (relative to the configuration directory) that
245# implements a search results scorer. If empty, the default will be used.
246#html_search_scorer = 'scorer.js'
247
248# Output file base name for HTML help builder.
249htmlhelp_basename = 'TheLinuxKerneldoc'
250
251# -- Options for LaTeX output ---------------------------------------------
252
253latex_elements = {
254# The paper size ('letterpaper' or 'a4paper').
255#'papersize': 'letterpaper',
256
257# The font size ('10pt', '11pt' or '12pt').
258#'pointsize': '10pt',
259
260# Additional stuff for the LaTeX preamble.
261#'preamble': '',
262
263# Latex figure (float) alignment
264#'figure_align': 'htbp',
265}
266
267# Grouping the document tree into LaTeX files. List of tuples
268# (source start file, target name, title,
269#  author, documentclass [howto, manual, or own class]).
270latex_documents = [
271    (master_doc, 'TheLinuxKernel.tex', 'The Linux Kernel Documentation',
272     'The kernel development community', 'manual'),
273]
274
275# The name of an image file (relative to this directory) to place at the top of
276# the title page.
277#latex_logo = None
278
279# For "manual" documents, if this is true, then toplevel headings are parts,
280# not chapters.
281#latex_use_parts = False
282
283# If true, show page references after internal links.
284#latex_show_pagerefs = False
285
286# If true, show URL addresses after external links.
287#latex_show_urls = False
288
289# Documents to append as an appendix to all manuals.
290#latex_appendices = []
291
292# If false, no module index is generated.
293#latex_domain_indices = True
294
295
296# -- Options for manual page output ---------------------------------------
297
298# One entry per manual page. List of tuples
299# (source start file, name, description, authors, manual section).
300man_pages = [
301    (master_doc, 'thelinuxkernel', 'The Linux Kernel Documentation',
302     [author], 1)
303]
304
305# If true, show URL addresses after external links.
306#man_show_urls = False
307
308
309# -- Options for Texinfo output -------------------------------------------
310
311# Grouping the document tree into Texinfo files. List of tuples
312# (source start file, target name, title, author,
313#  dir menu entry, description, category)
314texinfo_documents = [
315    (master_doc, 'TheLinuxKernel', 'The Linux Kernel Documentation',
316     author, 'TheLinuxKernel', 'One line description of project.',
317     'Miscellaneous'),
318]
319
320# Documents to append as an appendix to all manuals.
321#texinfo_appendices = []
322
323# If false, no module index is generated.
324#texinfo_domain_indices = True
325
326# How to display URL addresses: 'footnote', 'no', or 'inline'.
327#texinfo_show_urls = 'footnote'
328
329# If true, do not generate a @detailmenu in the "Top" node's menu.
330#texinfo_no_detailmenu = False
331
332
333# -- Options for Epub output ----------------------------------------------
334
335# Bibliographic Dublin Core info.
336epub_title = project
337epub_author = author
338epub_publisher = author
339epub_copyright = copyright
340
341# The basename for the epub file. It defaults to the project name.
342#epub_basename = project
343
344# The HTML theme for the epub output. Since the default themes are not
345# optimized for small screen space, using the same theme for HTML and epub
346# output is usually not wise. This defaults to 'epub', a theme designed to save
347# visual space.
348#epub_theme = 'epub'
349
350# The language of the text. It defaults to the language option
351# or 'en' if the language is not set.
352#epub_language = ''
353
354# The scheme of the identifier. Typical schemes are ISBN or URL.
355#epub_scheme = ''
356
357# The unique identifier of the text. This can be a ISBN number
358# or the project homepage.
359#epub_identifier = ''
360
361# A unique identification for the text.
362#epub_uid = ''
363
364# A tuple containing the cover image and cover page html template filenames.
365#epub_cover = ()
366
367# A sequence of (type, uri, title) tuples for the guide element of content.opf.
368#epub_guide = ()
369
370# HTML files that should be inserted before the pages created by sphinx.
371# The format is a list of tuples containing the path and title.
372#epub_pre_files = []
373
374# HTML files that should be inserted after the pages created by sphinx.
375# The format is a list of tuples containing the path and title.
376#epub_post_files = []
377
378# A list of files that should not be packed into the epub file.
379epub_exclude_files = ['search.html']
380
381# The depth of the table of contents in toc.ncx.
382#epub_tocdepth = 3
383
384# Allow duplicate toc entries.
385#epub_tocdup = True
386
387# Choose between 'default' and 'includehidden'.
388#epub_tocscope = 'default'
389
390# Fix unsupported image types using the Pillow.
391#epub_fix_images = False
392
393# Scale large images.
394#epub_max_image_width = 0
395
396# How to display URL addresses: 'footnote', 'no', or 'inline'.
397#epub_show_urls = 'inline'
398
399# If false, no index is generated.
400#epub_use_index = True
401
402#=======
403# rst2pdf
404#
405# Grouping the document tree into PDF files. List of tuples
406# (source start file, target name, title, author, options).
407#
408# See the Sphinx chapter of http://ralsina.me/static/manual.pdf
409#
410# FIXME: Do not add the index file here; the result will be too big. Adding
411# multiple PDF files here actually tries to get the cross-referencing right
412# *between* PDF files.
413pdf_documents = [
414    ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'),
415]
416
417# kernel-doc extension configuration for running Sphinx directly (e.g. by Read
418# the Docs). In a normal build, these are supplied from the Makefile via command
419# line arguments.
420kerneldoc_bin = '../scripts/kernel-doc'
421kerneldoc_srctree = '..'
422