Back to home page

LXR

 
 

    


0001 # -*- coding: utf-8 -*-
0002 #
0003 # The Linux Kernel documentation build configuration file, created by
0004 # sphinx-quickstart on Fri Feb 12 13:51:46 2016.
0005 #
0006 # This file is execfile()d with the current directory set to its
0007 # containing dir.
0008 #
0009 # Note that not all possible configuration values are present in this
0010 # autogenerated file.
0011 #
0012 # All configuration values have a default; values that are commented out
0013 # serve to show the default.
0014 
0015 import sys
0016 import os
0017 import sphinx
0018 
0019 # Get Sphinx version
0020 major, minor, patch = map(int, sphinx.__version__.split("."))
0021 
0022 
0023 # If extensions (or modules to document with autodoc) are in another directory,
0024 # add these directories to sys.path here. If the directory is relative to the
0025 # documentation root, use os.path.abspath to make it absolute, like shown here.
0026 sys.path.insert(0, os.path.abspath('sphinx'))
0027 from load_config import loadConfig
0028 
0029 # -- General configuration ------------------------------------------------
0030 
0031 # If your documentation needs a minimal Sphinx version, state it here.
0032 #needs_sphinx = '1.0'
0033 
0034 # Add any Sphinx extension module names here, as strings. They can be
0035 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
0036 # ones.
0037 extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain']
0038 
0039 # The name of the math extension changed on Sphinx 1.4
0040 if major == 1 and minor > 3:
0041     extensions.append("sphinx.ext.imgmath")
0042 else:
0043     extensions.append("sphinx.ext.pngmath")
0044 
0045 # Add any paths that contain templates here, relative to this directory.
0046 templates_path = ['_templates']
0047 
0048 # The suffix(es) of source filenames.
0049 # You can specify multiple suffix as a list of string:
0050 # source_suffix = ['.rst', '.md']
0051 source_suffix = '.rst'
0052 
0053 # The encoding of source files.
0054 #source_encoding = 'utf-8-sig'
0055 
0056 # The master toctree document.
0057 master_doc = 'index'
0058 
0059 # General information about the project.
0060 project = 'The Linux Kernel'
0061 copyright = '2016, The kernel development community'
0062 author = 'The kernel development community'
0063 
0064 # The version info for the project you're documenting, acts as replacement for
0065 # |version| and |release|, also used in various other places throughout the
0066 # built documents.
0067 #
0068 # In a normal build, version and release are are set to KERNELVERSION and
0069 # KERNELRELEASE, respectively, from the Makefile via Sphinx command line
0070 # arguments.
0071 #
0072 # The following code tries to extract the information by reading the Makefile,
0073 # when Sphinx is run directly (e.g. by Read the Docs).
0074 try:
0075     makefile_version = None
0076     makefile_patchlevel = None
0077     for line in open('../Makefile'):
0078         key, val = [x.strip() for x in line.split('=', 2)]
0079         if key == 'VERSION':
0080             makefile_version = val
0081         elif key == 'PATCHLEVEL':
0082             makefile_patchlevel = val
0083         if makefile_version and makefile_patchlevel:
0084             break
0085 except:
0086     pass
0087 finally:
0088     if makefile_version and makefile_patchlevel:
0089         version = release = makefile_version + '.' + makefile_patchlevel
0090     else:
0091         sys.stderr.write('Warning: Could not extract kernel version\n')
0092         version = release = "unknown version"
0093 
0094 # The language for content autogenerated by Sphinx. Refer to documentation
0095 # for a list of supported languages.
0096 #
0097 # This is also used if you do content translation via gettext catalogs.
0098 # Usually you set "language" from the command line for these cases.
0099 language = None
0100 
0101 # There are two options for replacing |today|: either, you set today to some
0102 # non-false value, then it is used:
0103 #today = ''
0104 # Else, today_fmt is used as the format for a strftime call.
0105 #today_fmt = '%B %d, %Y'
0106 
0107 # List of patterns, relative to source directory, that match files and
0108 # directories to ignore when looking for source files.
0109 exclude_patterns = ['output']
0110 
0111 # The reST default role (used for this markup: `text`) to use for all
0112 # documents.
0113 #default_role = None
0114 
0115 # If true, '()' will be appended to :func: etc. cross-reference text.
0116 #add_function_parentheses = True
0117 
0118 # If true, the current module name will be prepended to all description
0119 # unit titles (such as .. function::).
0120 #add_module_names = True
0121 
0122 # If true, sectionauthor and moduleauthor directives will be shown in the
0123 # output. They are ignored by default.
0124 #show_authors = False
0125 
0126 # The name of the Pygments (syntax highlighting) style to use.
0127 pygments_style = 'sphinx'
0128 
0129 # A list of ignored prefixes for module index sorting.
0130 #modindex_common_prefix = []
0131 
0132 # If true, keep warnings as "system message" paragraphs in the built documents.
0133 #keep_warnings = False
0134 
0135 # If true, `todo` and `todoList` produce output, else they produce nothing.
0136 todo_include_todos = False
0137 
0138 primary_domain = 'C'
0139 highlight_language = 'none'
0140 
0141 # -- Options for HTML output ----------------------------------------------
0142 
0143 # The theme to use for HTML and HTML Help pages.  See the documentation for
0144 # a list of builtin themes.
0145 
0146 # The Read the Docs theme is available from
0147 # - https://github.com/snide/sphinx_rtd_theme
0148 # - https://pypi.python.org/pypi/sphinx_rtd_theme
0149 # - python-sphinx-rtd-theme package (on Debian)
0150 try:
0151     import sphinx_rtd_theme
0152     html_theme = 'sphinx_rtd_theme'
0153     html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
0154 except ImportError:
0155     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')
0156 
0157 # Theme options are theme-specific and customize the look and feel of a theme
0158 # further.  For a list of options available for each theme, see the
0159 # documentation.
0160 #html_theme_options = {}
0161 
0162 # Add any paths that contain custom themes here, relative to this directory.
0163 #html_theme_path = []
0164 
0165 # The name for this set of Sphinx documents.  If None, it defaults to
0166 # "<project> v<release> documentation".
0167 #html_title = None
0168 
0169 # A shorter title for the navigation bar.  Default is the same as html_title.
0170 #html_short_title = None
0171 
0172 # The name of an image file (relative to this directory) to place at the top
0173 # of the sidebar.
0174 #html_logo = None
0175 
0176 # The name of an image file (within the static path) to use as favicon of the
0177 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
0178 # pixels large.
0179 #html_favicon = None
0180 
0181 # Add any paths that contain custom static files (such as style sheets) here,
0182 # relative to this directory. They are copied after the builtin static files,
0183 # so a file named "default.css" will overwrite the builtin "default.css".
0184 
0185 html_static_path = ['sphinx-static']
0186 
0187 html_context = {
0188     'css_files': [
0189         '_static/theme_overrides.css',
0190     ],
0191 }
0192 
0193 # Add any extra paths that contain custom files (such as robots.txt or
0194 # .htaccess) here, relative to this directory. These files are copied
0195 # directly to the root of the documentation.
0196 #html_extra_path = []
0197 
0198 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
0199 # using the given strftime format.
0200 #html_last_updated_fmt = '%b %d, %Y'
0201 
0202 # If true, SmartyPants will be used to convert quotes and dashes to
0203 # typographically correct entities.
0204 #html_use_smartypants = True
0205 
0206 # Custom sidebar templates, maps document names to template names.
0207 #html_sidebars = {}
0208 
0209 # Additional templates that should be rendered to pages, maps page names to
0210 # template names.
0211 #html_additional_pages = {}
0212 
0213 # If false, no module index is generated.
0214 #html_domain_indices = True
0215 
0216 # If false, no index is generated.
0217 #html_use_index = True
0218 
0219 # If true, the index is split into individual pages for each letter.
0220 #html_split_index = False
0221 
0222 # If true, links to the reST sources are added to the pages.
0223 #html_show_sourcelink = True
0224 
0225 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
0226 #html_show_sphinx = True
0227 
0228 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
0229 #html_show_copyright = True
0230 
0231 # If true, an OpenSearch description file will be output, and all pages will
0232 # contain a <link> tag referring to it.  The value of this option must be the
0233 # base URL from which the finished HTML is served.
0234 #html_use_opensearch = ''
0235 
0236 # This is the file name suffix for HTML files (e.g. ".xhtml").
0237 #html_file_suffix = None
0238 
0239 # Language to be used for generating the HTML full-text search index.
0240 # Sphinx supports the following languages:
0241 #   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
0242 #   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
0243 #html_search_language = 'en'
0244 
0245 # A dictionary with options for the search language support, empty by default.
0246 # Now only 'ja' uses this config value
0247 #html_search_options = {'type': 'default'}
0248 
0249 # The name of a javascript file (relative to the configuration directory) that
0250 # implements a search results scorer. If empty, the default will be used.
0251 #html_search_scorer = 'scorer.js'
0252 
0253 # Output file base name for HTML help builder.
0254 htmlhelp_basename = 'TheLinuxKerneldoc'
0255 
0256 # -- Options for LaTeX output ---------------------------------------------
0257 
0258 latex_elements = {
0259 # The paper size ('letterpaper' or 'a4paper').
0260 'papersize': 'a4paper',
0261 
0262 # The font size ('10pt', '11pt' or '12pt').
0263 'pointsize': '8pt',
0264 
0265 # Latex figure (float) alignment
0266 #'figure_align': 'htbp',
0267 
0268 # Don't mangle with UTF-8 chars
0269 'inputenc': '',
0270 'utf8extra': '',
0271 
0272 # Additional stuff for the LaTeX preamble.
0273     'preamble': '''
0274     % Adjust margins
0275     \\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}
0276 
0277         % Allow generate some pages in landscape
0278         \\usepackage{lscape}
0279 
0280         % Put notes in color and let them be inside a table
0281     \\definecolor{NoteColor}{RGB}{204,255,255}
0282     \\definecolor{WarningColor}{RGB}{255,204,204}
0283     \\definecolor{AttentionColor}{RGB}{255,255,204}
0284     \\definecolor{OtherColor}{RGB}{204,204,204}
0285         \\newlength{\\mynoticelength}
0286         \\makeatletter\\newenvironment{coloredbox}[1]{%
0287        \\setlength{\\fboxrule}{1pt}
0288        \\setlength{\\fboxsep}{7pt}
0289        \\setlength{\\mynoticelength}{\\linewidth}
0290        \\addtolength{\\mynoticelength}{-2\\fboxsep}
0291        \\addtolength{\\mynoticelength}{-2\\fboxrule}
0292            \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}%
0293        \\ifthenelse%
0294           {\\equal{\\py@noticetype}{note}}%
0295           {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
0296           {%
0297              \\ifthenelse%
0298              {\\equal{\\py@noticetype}{warning}}%
0299              {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
0300          {%
0301                 \\ifthenelse%
0302                 {\\equal{\\py@noticetype}{attention}}%
0303                 {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
0304                 {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
0305          }%
0306           }%
0307         }\\makeatother
0308 
0309         \\makeatletter
0310         \\renewenvironment{notice}[2]{%
0311           \\def\\py@noticetype{#1}
0312           \\begin{coloredbox}{#1}
0313           \\bf\\it
0314           \\par\\strong{#2}
0315           \\csname py@noticestart@#1\\endcsname
0316         }
0317     {
0318           \\csname py@noticeend@\\py@noticetype\\endcsname
0319           \\end{coloredbox}
0320         }
0321     \\makeatother
0322 
0323     % Use some font with UTF-8 support with XeLaTeX
0324         \\usepackage{fontspec}
0325         \\setsansfont{DejaVu Serif}
0326         \\setromanfont{DejaVu Sans}
0327         \\setmonofont{DejaVu Sans Mono}
0328 
0329     % To allow adjusting table sizes
0330     \\usepackage{adjustbox}
0331 
0332      '''
0333 }
0334 
0335 # Fix reference escape troubles with Sphinx 1.4.x
0336 if major == 1 and minor > 3:
0337     latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
0338 
0339 # Grouping the document tree into LaTeX files. List of tuples
0340 # (source start file, target name, title,
0341 #  author, documentclass [howto, manual, or own class]).
0342 latex_documents = [
0343     ('doc-guide/index', 'kernel-doc-guide.tex', 'Linux Kernel Documentation Guide',
0344      'The kernel development community', 'manual'),
0345     ('admin-guide/index', 'linux-user.tex', 'Linux Kernel User Documentation',
0346      'The kernel development community', 'manual'),
0347     ('core-api/index', 'core-api.tex', 'The kernel core API manual',
0348      'The kernel development community', 'manual'),
0349     ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual',
0350      'The kernel development community', 'manual'),
0351     ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation',
0352      'The kernel development community', 'manual'),
0353     ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation',
0354      'The kernel development community', 'manual'),
0355     ('gpu/index', 'gpu.tex', 'Linux GPU Driver Developer\'s Guide',
0356      'The kernel development community', 'manual'),
0357     ('media/index', 'media.tex', 'Linux Media Subsystem Documentation',
0358      'The kernel development community', 'manual'),
0359     ('security/index', 'security.tex', 'The kernel security subsystem manual',
0360      'The kernel development community', 'manual'),
0361 ]
0362 
0363 # The name of an image file (relative to this directory) to place at the top of
0364 # the title page.
0365 #latex_logo = None
0366 
0367 # For "manual" documents, if this is true, then toplevel headings are parts,
0368 # not chapters.
0369 #latex_use_parts = False
0370 
0371 # If true, show page references after internal links.
0372 #latex_show_pagerefs = False
0373 
0374 # If true, show URL addresses after external links.
0375 #latex_show_urls = False
0376 
0377 # Documents to append as an appendix to all manuals.
0378 #latex_appendices = []
0379 
0380 # If false, no module index is generated.
0381 #latex_domain_indices = True
0382 
0383 
0384 # -- Options for manual page output ---------------------------------------
0385 
0386 # One entry per manual page. List of tuples
0387 # (source start file, name, description, authors, manual section).
0388 man_pages = [
0389     (master_doc, 'thelinuxkernel', 'The Linux Kernel Documentation',
0390      [author], 1)
0391 ]
0392 
0393 # If true, show URL addresses after external links.
0394 #man_show_urls = False
0395 
0396 
0397 # -- Options for Texinfo output -------------------------------------------
0398 
0399 # Grouping the document tree into Texinfo files. List of tuples
0400 # (source start file, target name, title, author,
0401 #  dir menu entry, description, category)
0402 texinfo_documents = [
0403     (master_doc, 'TheLinuxKernel', 'The Linux Kernel Documentation',
0404      author, 'TheLinuxKernel', 'One line description of project.',
0405      'Miscellaneous'),
0406 ]
0407 
0408 # Documents to append as an appendix to all manuals.
0409 #texinfo_appendices = []
0410 
0411 # If false, no module index is generated.
0412 #texinfo_domain_indices = True
0413 
0414 # How to display URL addresses: 'footnote', 'no', or 'inline'.
0415 #texinfo_show_urls = 'footnote'
0416 
0417 # If true, do not generate a @detailmenu in the "Top" node's menu.
0418 #texinfo_no_detailmenu = False
0419 
0420 
0421 # -- Options for Epub output ----------------------------------------------
0422 
0423 # Bibliographic Dublin Core info.
0424 epub_title = project
0425 epub_author = author
0426 epub_publisher = author
0427 epub_copyright = copyright
0428 
0429 # The basename for the epub file. It defaults to the project name.
0430 #epub_basename = project
0431 
0432 # The HTML theme for the epub output. Since the default themes are not
0433 # optimized for small screen space, using the same theme for HTML and epub
0434 # output is usually not wise. This defaults to 'epub', a theme designed to save
0435 # visual space.
0436 #epub_theme = 'epub'
0437 
0438 # The language of the text. It defaults to the language option
0439 # or 'en' if the language is not set.
0440 #epub_language = ''
0441 
0442 # The scheme of the identifier. Typical schemes are ISBN or URL.
0443 #epub_scheme = ''
0444 
0445 # The unique identifier of the text. This can be a ISBN number
0446 # or the project homepage.
0447 #epub_identifier = ''
0448 
0449 # A unique identification for the text.
0450 #epub_uid = ''
0451 
0452 # A tuple containing the cover image and cover page html template filenames.
0453 #epub_cover = ()
0454 
0455 # A sequence of (type, uri, title) tuples for the guide element of content.opf.
0456 #epub_guide = ()
0457 
0458 # HTML files that should be inserted before the pages created by sphinx.
0459 # The format is a list of tuples containing the path and title.
0460 #epub_pre_files = []
0461 
0462 # HTML files that should be inserted after the pages created by sphinx.
0463 # The format is a list of tuples containing the path and title.
0464 #epub_post_files = []
0465 
0466 # A list of files that should not be packed into the epub file.
0467 epub_exclude_files = ['search.html']
0468 
0469 # The depth of the table of contents in toc.ncx.
0470 #epub_tocdepth = 3
0471 
0472 # Allow duplicate toc entries.
0473 #epub_tocdup = True
0474 
0475 # Choose between 'default' and 'includehidden'.
0476 #epub_tocscope = 'default'
0477 
0478 # Fix unsupported image types using the Pillow.
0479 #epub_fix_images = False
0480 
0481 # Scale large images.
0482 #epub_max_image_width = 0
0483 
0484 # How to display URL addresses: 'footnote', 'no', or 'inline'.
0485 #epub_show_urls = 'inline'
0486 
0487 # If false, no index is generated.
0488 #epub_use_index = True
0489 
0490 #=======
0491 # rst2pdf
0492 #
0493 # Grouping the document tree into PDF files. List of tuples
0494 # (source start file, target name, title, author, options).
0495 #
0496 # See the Sphinx chapter of http://ralsina.me/static/manual.pdf
0497 #
0498 # FIXME: Do not add the index file here; the result will be too big. Adding
0499 # multiple PDF files here actually tries to get the cross-referencing right
0500 # *between* PDF files.
0501 pdf_documents = [
0502     ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'),
0503 ]
0504 
0505 # kernel-doc extension configuration for running Sphinx directly (e.g. by Read
0506 # the Docs). In a normal build, these are supplied from the Makefile via command
0507 # line arguments.
0508 kerneldoc_bin = '../scripts/kernel-doc'
0509 kerneldoc_srctree = '..'
0510 
0511 # ------------------------------------------------------------------------------
0512 # Since loadConfig overwrites settings from the global namespace, it has to be
0513 # the last statement in the conf.py file
0514 # ------------------------------------------------------------------------------
0515 loadConfig(globals())