conf.py 14 KB

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