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