conf.py 15 KB

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