18c2ecf20Sopenharmony_ci# -*- coding: utf-8 -*-
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# The Linux Kernel documentation build configuration file, created by
48c2ecf20Sopenharmony_ci# sphinx-quickstart on Fri Feb 12 13:51:46 2016.
58c2ecf20Sopenharmony_ci#
68c2ecf20Sopenharmony_ci# This file is execfile()d with the current directory set to its
78c2ecf20Sopenharmony_ci# containing dir.
88c2ecf20Sopenharmony_ci#
98c2ecf20Sopenharmony_ci# Note that not all possible configuration values are present in this
108c2ecf20Sopenharmony_ci# autogenerated file.
118c2ecf20Sopenharmony_ci#
128c2ecf20Sopenharmony_ci# All configuration values have a default; values that are commented out
138c2ecf20Sopenharmony_ci# serve to show the default.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciimport sys
168c2ecf20Sopenharmony_ciimport os
178c2ecf20Sopenharmony_ciimport sphinx
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_cifrom subprocess import check_output
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci# Get Sphinx version
228c2ecf20Sopenharmony_cimajor, minor, patch = sphinx.version_info[:3]
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci# If extensions (or modules to document with autodoc) are in another directory,
268c2ecf20Sopenharmony_ci# add these directories to sys.path here. If the directory is relative to the
278c2ecf20Sopenharmony_ci# documentation root, use os.path.abspath to make it absolute, like shown here.
288c2ecf20Sopenharmony_cisys.path.insert(0, os.path.abspath('sphinx'))
298c2ecf20Sopenharmony_cifrom load_config import loadConfig
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci# -- General configuration ------------------------------------------------
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci# If your documentation needs a minimal Sphinx version, state it here.
348c2ecf20Sopenharmony_cineeds_sphinx = '1.3'
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci# Add any Sphinx extension module names here, as strings. They can be
378c2ecf20Sopenharmony_ci# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
388c2ecf20Sopenharmony_ci# ones.
398c2ecf20Sopenharmony_ciextensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
408c2ecf20Sopenharmony_ci              'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
418c2ecf20Sopenharmony_ci              'maintainers_include', 'sphinx.ext.autosectionlabel',
428c2ecf20Sopenharmony_ci              'kernel_abi']
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#
458c2ecf20Sopenharmony_ci# cdomain is badly broken in Sphinx 3+.  Leaving it out generates *most*
468c2ecf20Sopenharmony_ci# of the docs correctly, but not all.  Scream bloody murder but allow
478c2ecf20Sopenharmony_ci# the process to proceed; hopefully somebody will fix this properly soon.
488c2ecf20Sopenharmony_ci#
498c2ecf20Sopenharmony_ciif major >= 3:
508c2ecf20Sopenharmony_ci    sys.stderr.write('''WARNING: The kernel documentation build process
518c2ecf20Sopenharmony_ci        support for Sphinx v3.0 and above is brand new. Be prepared for
528c2ecf20Sopenharmony_ci        possible issues in the generated output.
538c2ecf20Sopenharmony_ci        ''')
548c2ecf20Sopenharmony_ci    if (major > 3) or (minor > 0 or patch >= 2):
558c2ecf20Sopenharmony_ci        # Sphinx c function parser is more pedantic with regards to type
568c2ecf20Sopenharmony_ci        # checking. Due to that, having macros at c:function cause problems.
578c2ecf20Sopenharmony_ci        # Those needed to be scaped by using c_id_attributes[] array
588c2ecf20Sopenharmony_ci        c_id_attributes = [
598c2ecf20Sopenharmony_ci            # GCC Compiler types not parsed by Sphinx:
608c2ecf20Sopenharmony_ci            "__restrict__",
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci            # include/linux/compiler_types.h:
638c2ecf20Sopenharmony_ci            "__iomem",
648c2ecf20Sopenharmony_ci            "__kernel",
658c2ecf20Sopenharmony_ci            "noinstr",
668c2ecf20Sopenharmony_ci            "notrace",
678c2ecf20Sopenharmony_ci            "__percpu",
688c2ecf20Sopenharmony_ci            "__rcu",
698c2ecf20Sopenharmony_ci            "__user",
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci            # include/linux/compiler_attributes.h:
728c2ecf20Sopenharmony_ci            "__alias",
738c2ecf20Sopenharmony_ci            "__aligned",
748c2ecf20Sopenharmony_ci            "__aligned_largest",
758c2ecf20Sopenharmony_ci            "__always_inline",
768c2ecf20Sopenharmony_ci            "__assume_aligned",
778c2ecf20Sopenharmony_ci            "__cold",
788c2ecf20Sopenharmony_ci            "__attribute_const__",
798c2ecf20Sopenharmony_ci            "__copy",
808c2ecf20Sopenharmony_ci            "__pure",
818c2ecf20Sopenharmony_ci            "__designated_init",
828c2ecf20Sopenharmony_ci            "__visible",
838c2ecf20Sopenharmony_ci            "__printf",
848c2ecf20Sopenharmony_ci            "__scanf",
858c2ecf20Sopenharmony_ci            "__gnu_inline",
868c2ecf20Sopenharmony_ci            "__malloc",
878c2ecf20Sopenharmony_ci            "__mode",
888c2ecf20Sopenharmony_ci            "__no_caller_saved_registers",
898c2ecf20Sopenharmony_ci            "__noclone",
908c2ecf20Sopenharmony_ci            "__nonstring",
918c2ecf20Sopenharmony_ci            "__noreturn",
928c2ecf20Sopenharmony_ci            "__packed",
938c2ecf20Sopenharmony_ci            "__pure",
948c2ecf20Sopenharmony_ci            "__section",
958c2ecf20Sopenharmony_ci            "__always_unused",
968c2ecf20Sopenharmony_ci            "__maybe_unused",
978c2ecf20Sopenharmony_ci            "__used",
988c2ecf20Sopenharmony_ci            "__weak",
998c2ecf20Sopenharmony_ci            "noinline",
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci            # include/linux/memblock.h:
1028c2ecf20Sopenharmony_ci            "__init_memblock",
1038c2ecf20Sopenharmony_ci            "__meminit",
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci            # include/linux/init.h:
1068c2ecf20Sopenharmony_ci            "__init",
1078c2ecf20Sopenharmony_ci            "__ref",
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci            # include/linux/linkage.h:
1108c2ecf20Sopenharmony_ci            "asmlinkage",
1118c2ecf20Sopenharmony_ci        ]
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_cielse:
1148c2ecf20Sopenharmony_ci    extensions.append('cdomain')
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci# Ensure that autosectionlabel will produce unique names
1178c2ecf20Sopenharmony_ciautosectionlabel_prefix_document = True
1188c2ecf20Sopenharmony_ciautosectionlabel_maxdepth = 2
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci# The name of the math extension changed on Sphinx 1.4
1218c2ecf20Sopenharmony_ciif (major == 1 and minor > 3) or (major > 1):
1228c2ecf20Sopenharmony_ci    extensions.append("sphinx.ext.imgmath")
1238c2ecf20Sopenharmony_cielse:
1248c2ecf20Sopenharmony_ci    extensions.append("sphinx.ext.pngmath")
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci# Add any paths that contain templates here, relative to this directory.
1278c2ecf20Sopenharmony_citemplates_path = ['_templates']
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci# The suffix(es) of source filenames.
1308c2ecf20Sopenharmony_ci# You can specify multiple suffix as a list of string:
1318c2ecf20Sopenharmony_ci# source_suffix = ['.rst', '.md']
1328c2ecf20Sopenharmony_cisource_suffix = '.rst'
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci# The encoding of source files.
1358c2ecf20Sopenharmony_ci#source_encoding = 'utf-8-sig'
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci# The master toctree document.
1388c2ecf20Sopenharmony_cimaster_doc = 'index'
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci# General information about the project.
1418c2ecf20Sopenharmony_ciproject = 'The Linux Kernel'
1428c2ecf20Sopenharmony_cicopyright = 'The kernel development community'
1438c2ecf20Sopenharmony_ciauthor = 'The kernel development community'
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci# The version info for the project you're documenting, acts as replacement for
1468c2ecf20Sopenharmony_ci# |version| and |release|, also used in various other places throughout the
1478c2ecf20Sopenharmony_ci# built documents.
1488c2ecf20Sopenharmony_ci#
1498c2ecf20Sopenharmony_ci# In a normal build, version and release are are set to KERNELVERSION and
1508c2ecf20Sopenharmony_ci# KERNELRELEASE, respectively, from the Makefile via Sphinx command line
1518c2ecf20Sopenharmony_ci# arguments.
1528c2ecf20Sopenharmony_ci#
1538c2ecf20Sopenharmony_ci# The following code tries to extract the information by reading the Makefile,
1548c2ecf20Sopenharmony_ci# when Sphinx is run directly (e.g. by Read the Docs).
1558c2ecf20Sopenharmony_citry:
1568c2ecf20Sopenharmony_ci    makefile_version = None
1578c2ecf20Sopenharmony_ci    makefile_patchlevel = None
1588c2ecf20Sopenharmony_ci    for line in open('../Makefile'):
1598c2ecf20Sopenharmony_ci        key, val = [x.strip() for x in line.split('=', 2)]
1608c2ecf20Sopenharmony_ci        if key == 'VERSION':
1618c2ecf20Sopenharmony_ci            makefile_version = val
1628c2ecf20Sopenharmony_ci        elif key == 'PATCHLEVEL':
1638c2ecf20Sopenharmony_ci            makefile_patchlevel = val
1648c2ecf20Sopenharmony_ci        if makefile_version and makefile_patchlevel:
1658c2ecf20Sopenharmony_ci            break
1668c2ecf20Sopenharmony_ciexcept:
1678c2ecf20Sopenharmony_ci    pass
1688c2ecf20Sopenharmony_cifinally:
1698c2ecf20Sopenharmony_ci    if makefile_version and makefile_patchlevel:
1708c2ecf20Sopenharmony_ci        version = release = makefile_version + '.' + makefile_patchlevel
1718c2ecf20Sopenharmony_ci    else:
1728c2ecf20Sopenharmony_ci        version = release = "unknown version"
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci# The language for content autogenerated by Sphinx. Refer to documentation
1758c2ecf20Sopenharmony_ci# for a list of supported languages.
1768c2ecf20Sopenharmony_ci#
1778c2ecf20Sopenharmony_ci# This is also used if you do content translation via gettext catalogs.
1788c2ecf20Sopenharmony_ci# Usually you set "language" from the command line for these cases.
1798c2ecf20Sopenharmony_cilanguage = 'en'
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci# There are two options for replacing |today|: either, you set today to some
1828c2ecf20Sopenharmony_ci# non-false value, then it is used:
1838c2ecf20Sopenharmony_ci#today = ''
1848c2ecf20Sopenharmony_ci# Else, today_fmt is used as the format for a strftime call.
1858c2ecf20Sopenharmony_ci#today_fmt = '%B %d, %Y'
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci# List of patterns, relative to source directory, that match files and
1888c2ecf20Sopenharmony_ci# directories to ignore when looking for source files.
1898c2ecf20Sopenharmony_ciexclude_patterns = ['output']
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci# The reST default role (used for this markup: `text`) to use for all
1928c2ecf20Sopenharmony_ci# documents.
1938c2ecf20Sopenharmony_ci#default_role = None
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci# If true, '()' will be appended to :func: etc. cross-reference text.
1968c2ecf20Sopenharmony_ci#add_function_parentheses = True
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci# If true, the current module name will be prepended to all description
1998c2ecf20Sopenharmony_ci# unit titles (such as .. function::).
2008c2ecf20Sopenharmony_ci#add_module_names = True
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci# If true, sectionauthor and moduleauthor directives will be shown in the
2038c2ecf20Sopenharmony_ci# output. They are ignored by default.
2048c2ecf20Sopenharmony_ci#show_authors = False
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci# The name of the Pygments (syntax highlighting) style to use.
2078c2ecf20Sopenharmony_cipygments_style = 'sphinx'
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci# A list of ignored prefixes for module index sorting.
2108c2ecf20Sopenharmony_ci#modindex_common_prefix = []
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci# If true, keep warnings as "system message" paragraphs in the built documents.
2138c2ecf20Sopenharmony_ci#keep_warnings = False
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci# If true, `todo` and `todoList` produce output, else they produce nothing.
2168c2ecf20Sopenharmony_citodo_include_todos = False
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ciprimary_domain = 'c'
2198c2ecf20Sopenharmony_cihighlight_language = 'none'
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci# -- Options for HTML output ----------------------------------------------
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci# The theme to use for HTML and HTML Help pages.  See the documentation for
2248c2ecf20Sopenharmony_ci# a list of builtin themes.
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci# The Read the Docs theme is available from
2278c2ecf20Sopenharmony_ci# - https://github.com/snide/sphinx_rtd_theme
2288c2ecf20Sopenharmony_ci# - https://pypi.python.org/pypi/sphinx_rtd_theme
2298c2ecf20Sopenharmony_ci# - python-sphinx-rtd-theme package (on Debian)
2308c2ecf20Sopenharmony_citry:
2318c2ecf20Sopenharmony_ci    import sphinx_rtd_theme
2328c2ecf20Sopenharmony_ci    html_theme = 'sphinx_rtd_theme'
2338c2ecf20Sopenharmony_ci    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
2348c2ecf20Sopenharmony_ciexcept ImportError:
2358c2ecf20Sopenharmony_ci    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')
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci# Theme options are theme-specific and customize the look and feel of a theme
2388c2ecf20Sopenharmony_ci# further.  For a list of options available for each theme, see the
2398c2ecf20Sopenharmony_ci# documentation.
2408c2ecf20Sopenharmony_ci#html_theme_options = {}
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci# Add any paths that contain custom themes here, relative to this directory.
2438c2ecf20Sopenharmony_ci#html_theme_path = []
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci# The name for this set of Sphinx documents.  If None, it defaults to
2468c2ecf20Sopenharmony_ci# "<project> v<release> documentation".
2478c2ecf20Sopenharmony_ci#html_title = None
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci# A shorter title for the navigation bar.  Default is the same as html_title.
2508c2ecf20Sopenharmony_ci#html_short_title = None
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci# The name of an image file (relative to this directory) to place at the top
2538c2ecf20Sopenharmony_ci# of the sidebar.
2548c2ecf20Sopenharmony_ci#html_logo = None
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci# The name of an image file (within the static path) to use as favicon of the
2578c2ecf20Sopenharmony_ci# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
2588c2ecf20Sopenharmony_ci# pixels large.
2598c2ecf20Sopenharmony_ci#html_favicon = None
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci# Add any paths that contain custom static files (such as style sheets) here,
2628c2ecf20Sopenharmony_ci# relative to this directory. They are copied after the builtin static files,
2638c2ecf20Sopenharmony_ci# so a file named "default.css" will overwrite the builtin "default.css".
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_cihtml_static_path = ['sphinx-static']
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_cihtml_context = {
2688c2ecf20Sopenharmony_ci    'css_files': [
2698c2ecf20Sopenharmony_ci        '_static/theme_overrides.css',
2708c2ecf20Sopenharmony_ci    ],
2718c2ecf20Sopenharmony_ci}
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci# Add any extra paths that contain custom files (such as robots.txt or
2748c2ecf20Sopenharmony_ci# .htaccess) here, relative to this directory. These files are copied
2758c2ecf20Sopenharmony_ci# directly to the root of the documentation.
2768c2ecf20Sopenharmony_ci#html_extra_path = []
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
2798c2ecf20Sopenharmony_ci# using the given strftime format.
2808c2ecf20Sopenharmony_ci#html_last_updated_fmt = '%b %d, %Y'
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci# If true, SmartyPants will be used to convert quotes and dashes to
2838c2ecf20Sopenharmony_ci# typographically correct entities.
2848c2ecf20Sopenharmony_cihtml_use_smartypants = False
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci# Custom sidebar templates, maps document names to template names.
2878c2ecf20Sopenharmony_ci#html_sidebars = {}
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci# Additional templates that should be rendered to pages, maps page names to
2908c2ecf20Sopenharmony_ci# template names.
2918c2ecf20Sopenharmony_ci#html_additional_pages = {}
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci# If false, no module index is generated.
2948c2ecf20Sopenharmony_ci#html_domain_indices = True
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci# If false, no index is generated.
2978c2ecf20Sopenharmony_ci#html_use_index = True
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci# If true, the index is split into individual pages for each letter.
3008c2ecf20Sopenharmony_ci#html_split_index = False
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci# If true, links to the reST sources are added to the pages.
3038c2ecf20Sopenharmony_ci#html_show_sourcelink = True
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
3068c2ecf20Sopenharmony_ci#html_show_sphinx = True
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
3098c2ecf20Sopenharmony_ci#html_show_copyright = True
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci# If true, an OpenSearch description file will be output, and all pages will
3128c2ecf20Sopenharmony_ci# contain a <link> tag referring to it.  The value of this option must be the
3138c2ecf20Sopenharmony_ci# base URL from which the finished HTML is served.
3148c2ecf20Sopenharmony_ci#html_use_opensearch = ''
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci# This is the file name suffix for HTML files (e.g. ".xhtml").
3178c2ecf20Sopenharmony_ci#html_file_suffix = None
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci# Language to be used for generating the HTML full-text search index.
3208c2ecf20Sopenharmony_ci# Sphinx supports the following languages:
3218c2ecf20Sopenharmony_ci#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
3228c2ecf20Sopenharmony_ci#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
3238c2ecf20Sopenharmony_ci#html_search_language = 'en'
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci# A dictionary with options for the search language support, empty by default.
3268c2ecf20Sopenharmony_ci# Now only 'ja' uses this config value
3278c2ecf20Sopenharmony_ci#html_search_options = {'type': 'default'}
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci# The name of a javascript file (relative to the configuration directory) that
3308c2ecf20Sopenharmony_ci# implements a search results scorer. If empty, the default will be used.
3318c2ecf20Sopenharmony_ci#html_search_scorer = 'scorer.js'
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci# Output file base name for HTML help builder.
3348c2ecf20Sopenharmony_cihtmlhelp_basename = 'TheLinuxKerneldoc'
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci# -- Options for LaTeX output ---------------------------------------------
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_cilatex_elements = {
3398c2ecf20Sopenharmony_ci# The paper size ('letterpaper' or 'a4paper').
3408c2ecf20Sopenharmony_ci'papersize': 'a4paper',
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci# The font size ('10pt', '11pt' or '12pt').
3438c2ecf20Sopenharmony_ci'pointsize': '11pt',
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci# Latex figure (float) alignment
3468c2ecf20Sopenharmony_ci#'figure_align': 'htbp',
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci# Don't mangle with UTF-8 chars
3498c2ecf20Sopenharmony_ci'inputenc': '',
3508c2ecf20Sopenharmony_ci'utf8extra': '',
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ci# Additional stuff for the LaTeX preamble.
3538c2ecf20Sopenharmony_ci    'preamble': '''
3548c2ecf20Sopenharmony_ci	% Use some font with UTF-8 support with XeLaTeX
3558c2ecf20Sopenharmony_ci        \\usepackage{fontspec}
3568c2ecf20Sopenharmony_ci        \\setsansfont{DejaVu Sans}
3578c2ecf20Sopenharmony_ci        \\setromanfont{DejaVu Serif}
3588c2ecf20Sopenharmony_ci        \\setmonofont{DejaVu Sans Mono}
3598c2ecf20Sopenharmony_ci     '''
3608c2ecf20Sopenharmony_ci}
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci# At least one book (translations) may have Asian characters
3638c2ecf20Sopenharmony_ci# with are only displayed if xeCJK is used
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_cicjk_cmd = check_output(['fc-list', '--format="%{family[0]}\n"']).decode('utf-8', 'ignore')
3668c2ecf20Sopenharmony_ciif cjk_cmd.find("Noto Sans CJK SC") >= 0:
3678c2ecf20Sopenharmony_ci    print ("enabling CJK for LaTeX builder")
3688c2ecf20Sopenharmony_ci    latex_elements['preamble']  += '''
3698c2ecf20Sopenharmony_ci	% This is needed for translations
3708c2ecf20Sopenharmony_ci        \\usepackage{xeCJK}
3718c2ecf20Sopenharmony_ci        \\setCJKmainfont{Noto Sans CJK SC}
3728c2ecf20Sopenharmony_ci     '''
3738c2ecf20Sopenharmony_ci
3748c2ecf20Sopenharmony_ci# Fix reference escape troubles with Sphinx 1.4.x
3758c2ecf20Sopenharmony_ciif major == 1 and minor > 3:
3768c2ecf20Sopenharmony_ci    latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ciif major == 1 and minor <= 4:
3798c2ecf20Sopenharmony_ci    latex_elements['preamble']  += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
3808c2ecf20Sopenharmony_cielif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
3818c2ecf20Sopenharmony_ci    latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
3828c2ecf20Sopenharmony_ci    latex_elements['preamble']  += '\\fvset{fontsize=auto}\n'
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci# Customize notice background colors on Sphinx < 1.6:
3858c2ecf20Sopenharmony_ciif major == 1 and minor < 6:
3868c2ecf20Sopenharmony_ci   latex_elements['preamble']  += '''
3878c2ecf20Sopenharmony_ci        \\usepackage{ifthen}
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci        % Put notes in color and let them be inside a table
3908c2ecf20Sopenharmony_ci	\\definecolor{NoteColor}{RGB}{204,255,255}
3918c2ecf20Sopenharmony_ci	\\definecolor{WarningColor}{RGB}{255,204,204}
3928c2ecf20Sopenharmony_ci	\\definecolor{AttentionColor}{RGB}{255,255,204}
3938c2ecf20Sopenharmony_ci	\\definecolor{ImportantColor}{RGB}{192,255,204}
3948c2ecf20Sopenharmony_ci	\\definecolor{OtherColor}{RGB}{204,204,204}
3958c2ecf20Sopenharmony_ci        \\newlength{\\mynoticelength}
3968c2ecf20Sopenharmony_ci        \\makeatletter\\newenvironment{coloredbox}[1]{%
3978c2ecf20Sopenharmony_ci	   \\setlength{\\fboxrule}{1pt}
3988c2ecf20Sopenharmony_ci	   \\setlength{\\fboxsep}{7pt}
3998c2ecf20Sopenharmony_ci	   \\setlength{\\mynoticelength}{\\linewidth}
4008c2ecf20Sopenharmony_ci	   \\addtolength{\\mynoticelength}{-2\\fboxsep}
4018c2ecf20Sopenharmony_ci	   \\addtolength{\\mynoticelength}{-2\\fboxrule}
4028c2ecf20Sopenharmony_ci           \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}%
4038c2ecf20Sopenharmony_ci	   \\ifthenelse%
4048c2ecf20Sopenharmony_ci	      {\\equal{\\py@noticetype}{note}}%
4058c2ecf20Sopenharmony_ci	      {\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
4068c2ecf20Sopenharmony_ci	      {%
4078c2ecf20Sopenharmony_ci	         \\ifthenelse%
4088c2ecf20Sopenharmony_ci	         {\\equal{\\py@noticetype}{warning}}%
4098c2ecf20Sopenharmony_ci	         {\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
4108c2ecf20Sopenharmony_ci		 {%
4118c2ecf20Sopenharmony_ci	            \\ifthenelse%
4128c2ecf20Sopenharmony_ci	            {\\equal{\\py@noticetype}{attention}}%
4138c2ecf20Sopenharmony_ci	            {\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
4148c2ecf20Sopenharmony_ci		    {%
4158c2ecf20Sopenharmony_ci	               \\ifthenelse%
4168c2ecf20Sopenharmony_ci	               {\\equal{\\py@noticetype}{important}}%
4178c2ecf20Sopenharmony_ci	               {\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}%
4188c2ecf20Sopenharmony_ci	               {\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
4198c2ecf20Sopenharmony_ci		    }%
4208c2ecf20Sopenharmony_ci		 }%
4218c2ecf20Sopenharmony_ci	      }%
4228c2ecf20Sopenharmony_ci        }\\makeatother
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_ci        \\makeatletter
4258c2ecf20Sopenharmony_ci        \\renewenvironment{notice}[2]{%
4268c2ecf20Sopenharmony_ci          \\def\\py@noticetype{#1}
4278c2ecf20Sopenharmony_ci          \\begin{coloredbox}{#1}
4288c2ecf20Sopenharmony_ci          \\bf\\it
4298c2ecf20Sopenharmony_ci          \\par\\strong{#2}
4308c2ecf20Sopenharmony_ci          \\csname py@noticestart@#1\\endcsname
4318c2ecf20Sopenharmony_ci        }
4328c2ecf20Sopenharmony_ci	{
4338c2ecf20Sopenharmony_ci          \\csname py@noticeend@\\py@noticetype\\endcsname
4348c2ecf20Sopenharmony_ci          \\end{coloredbox}
4358c2ecf20Sopenharmony_ci        }
4368c2ecf20Sopenharmony_ci	\\makeatother
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_ci     '''
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci# With Sphinx 1.6, it is possible to change the Bg color directly
4418c2ecf20Sopenharmony_ci# by using:
4428c2ecf20Sopenharmony_ci#	\definecolor{sphinxnoteBgColor}{RGB}{204,255,255}
4438c2ecf20Sopenharmony_ci#	\definecolor{sphinxwarningBgColor}{RGB}{255,204,204}
4448c2ecf20Sopenharmony_ci#	\definecolor{sphinxattentionBgColor}{RGB}{255,255,204}
4458c2ecf20Sopenharmony_ci#	\definecolor{sphinximportantBgColor}{RGB}{192,255,204}
4468c2ecf20Sopenharmony_ci#
4478c2ecf20Sopenharmony_ci# However, it require to use sphinx heavy box with:
4488c2ecf20Sopenharmony_ci#
4498c2ecf20Sopenharmony_ci#	\renewenvironment{sphinxlightbox} {%
4508c2ecf20Sopenharmony_ci#		\\begin{sphinxheavybox}
4518c2ecf20Sopenharmony_ci#	}
4528c2ecf20Sopenharmony_ci#		\\end{sphinxheavybox}
4538c2ecf20Sopenharmony_ci#	}
4548c2ecf20Sopenharmony_ci#
4558c2ecf20Sopenharmony_ci# Unfortunately, the implementation is buggy: if a note is inside a
4568c2ecf20Sopenharmony_ci# table, it isn't displayed well. So, for now, let's use boring
4578c2ecf20Sopenharmony_ci# black and white notes.
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci# Grouping the document tree into LaTeX files. List of tuples
4608c2ecf20Sopenharmony_ci# (source start file, target name, title,
4618c2ecf20Sopenharmony_ci#  author, documentclass [howto, manual, or own class]).
4628c2ecf20Sopenharmony_ci# Sorted in alphabetical order
4638c2ecf20Sopenharmony_cilatex_documents = [
4648c2ecf20Sopenharmony_ci]
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_ci# Add all other index files from Documentation/ subdirectories
4678c2ecf20Sopenharmony_cifor fn in os.listdir('.'):
4688c2ecf20Sopenharmony_ci    doc = os.path.join(fn, "index")
4698c2ecf20Sopenharmony_ci    if os.path.exists(doc + ".rst"):
4708c2ecf20Sopenharmony_ci        has = False
4718c2ecf20Sopenharmony_ci        for l in latex_documents:
4728c2ecf20Sopenharmony_ci            if l[0] == doc:
4738c2ecf20Sopenharmony_ci                has = True
4748c2ecf20Sopenharmony_ci                break
4758c2ecf20Sopenharmony_ci        if not has:
4768c2ecf20Sopenharmony_ci            latex_documents.append((doc, fn + '.tex',
4778c2ecf20Sopenharmony_ci                                    'Linux %s Documentation' % fn.capitalize(),
4788c2ecf20Sopenharmony_ci                                    'The kernel development community',
4798c2ecf20Sopenharmony_ci                                    'manual'))
4808c2ecf20Sopenharmony_ci
4818c2ecf20Sopenharmony_ci# The name of an image file (relative to this directory) to place at the top of
4828c2ecf20Sopenharmony_ci# the title page.
4838c2ecf20Sopenharmony_ci#latex_logo = None
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci# For "manual" documents, if this is true, then toplevel headings are parts,
4868c2ecf20Sopenharmony_ci# not chapters.
4878c2ecf20Sopenharmony_ci#latex_use_parts = False
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_ci# If true, show page references after internal links.
4908c2ecf20Sopenharmony_ci#latex_show_pagerefs = False
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci# If true, show URL addresses after external links.
4938c2ecf20Sopenharmony_ci#latex_show_urls = False
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci# Documents to append as an appendix to all manuals.
4968c2ecf20Sopenharmony_ci#latex_appendices = []
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci# If false, no module index is generated.
4998c2ecf20Sopenharmony_ci#latex_domain_indices = True
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_ci
5028c2ecf20Sopenharmony_ci# -- Options for manual page output ---------------------------------------
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci# One entry per manual page. List of tuples
5058c2ecf20Sopenharmony_ci# (source start file, name, description, authors, manual section).
5068c2ecf20Sopenharmony_ciman_pages = [
5078c2ecf20Sopenharmony_ci    (master_doc, 'thelinuxkernel', 'The Linux Kernel Documentation',
5088c2ecf20Sopenharmony_ci     [author], 1)
5098c2ecf20Sopenharmony_ci]
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci# If true, show URL addresses after external links.
5128c2ecf20Sopenharmony_ci#man_show_urls = False
5138c2ecf20Sopenharmony_ci
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ci# -- Options for Texinfo output -------------------------------------------
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci# Grouping the document tree into Texinfo files. List of tuples
5188c2ecf20Sopenharmony_ci# (source start file, target name, title, author,
5198c2ecf20Sopenharmony_ci#  dir menu entry, description, category)
5208c2ecf20Sopenharmony_citexinfo_documents = [
5218c2ecf20Sopenharmony_ci    (master_doc, 'TheLinuxKernel', 'The Linux Kernel Documentation',
5228c2ecf20Sopenharmony_ci     author, 'TheLinuxKernel', 'One line description of project.',
5238c2ecf20Sopenharmony_ci     'Miscellaneous'),
5248c2ecf20Sopenharmony_ci]
5258c2ecf20Sopenharmony_ci
5268c2ecf20Sopenharmony_ci# Documents to append as an appendix to all manuals.
5278c2ecf20Sopenharmony_ci#texinfo_appendices = []
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci# If false, no module index is generated.
5308c2ecf20Sopenharmony_ci#texinfo_domain_indices = True
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_ci# How to display URL addresses: 'footnote', 'no', or 'inline'.
5338c2ecf20Sopenharmony_ci#texinfo_show_urls = 'footnote'
5348c2ecf20Sopenharmony_ci
5358c2ecf20Sopenharmony_ci# If true, do not generate a @detailmenu in the "Top" node's menu.
5368c2ecf20Sopenharmony_ci#texinfo_no_detailmenu = False
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci# -- Options for Epub output ----------------------------------------------
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_ci# Bibliographic Dublin Core info.
5428c2ecf20Sopenharmony_ciepub_title = project
5438c2ecf20Sopenharmony_ciepub_author = author
5448c2ecf20Sopenharmony_ciepub_publisher = author
5458c2ecf20Sopenharmony_ciepub_copyright = copyright
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_ci# The basename for the epub file. It defaults to the project name.
5488c2ecf20Sopenharmony_ci#epub_basename = project
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_ci# The HTML theme for the epub output. Since the default themes are not
5518c2ecf20Sopenharmony_ci# optimized for small screen space, using the same theme for HTML and epub
5528c2ecf20Sopenharmony_ci# output is usually not wise. This defaults to 'epub', a theme designed to save
5538c2ecf20Sopenharmony_ci# visual space.
5548c2ecf20Sopenharmony_ci#epub_theme = 'epub'
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_ci# The language of the text. It defaults to the language option
5578c2ecf20Sopenharmony_ci# or 'en' if the language is not set.
5588c2ecf20Sopenharmony_ci#epub_language = ''
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci# The scheme of the identifier. Typical schemes are ISBN or URL.
5618c2ecf20Sopenharmony_ci#epub_scheme = ''
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_ci# The unique identifier of the text. This can be a ISBN number
5648c2ecf20Sopenharmony_ci# or the project homepage.
5658c2ecf20Sopenharmony_ci#epub_identifier = ''
5668c2ecf20Sopenharmony_ci
5678c2ecf20Sopenharmony_ci# A unique identification for the text.
5688c2ecf20Sopenharmony_ci#epub_uid = ''
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_ci# A tuple containing the cover image and cover page html template filenames.
5718c2ecf20Sopenharmony_ci#epub_cover = ()
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_ci# A sequence of (type, uri, title) tuples for the guide element of content.opf.
5748c2ecf20Sopenharmony_ci#epub_guide = ()
5758c2ecf20Sopenharmony_ci
5768c2ecf20Sopenharmony_ci# HTML files that should be inserted before the pages created by sphinx.
5778c2ecf20Sopenharmony_ci# The format is a list of tuples containing the path and title.
5788c2ecf20Sopenharmony_ci#epub_pre_files = []
5798c2ecf20Sopenharmony_ci
5808c2ecf20Sopenharmony_ci# HTML files that should be inserted after the pages created by sphinx.
5818c2ecf20Sopenharmony_ci# The format is a list of tuples containing the path and title.
5828c2ecf20Sopenharmony_ci#epub_post_files = []
5838c2ecf20Sopenharmony_ci
5848c2ecf20Sopenharmony_ci# A list of files that should not be packed into the epub file.
5858c2ecf20Sopenharmony_ciepub_exclude_files = ['search.html']
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_ci# The depth of the table of contents in toc.ncx.
5888c2ecf20Sopenharmony_ci#epub_tocdepth = 3
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci# Allow duplicate toc entries.
5918c2ecf20Sopenharmony_ci#epub_tocdup = True
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_ci# Choose between 'default' and 'includehidden'.
5948c2ecf20Sopenharmony_ci#epub_tocscope = 'default'
5958c2ecf20Sopenharmony_ci
5968c2ecf20Sopenharmony_ci# Fix unsupported image types using the Pillow.
5978c2ecf20Sopenharmony_ci#epub_fix_images = False
5988c2ecf20Sopenharmony_ci
5998c2ecf20Sopenharmony_ci# Scale large images.
6008c2ecf20Sopenharmony_ci#epub_max_image_width = 0
6018c2ecf20Sopenharmony_ci
6028c2ecf20Sopenharmony_ci# How to display URL addresses: 'footnote', 'no', or 'inline'.
6038c2ecf20Sopenharmony_ci#epub_show_urls = 'inline'
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci# If false, no index is generated.
6068c2ecf20Sopenharmony_ci#epub_use_index = True
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_ci#=======
6098c2ecf20Sopenharmony_ci# rst2pdf
6108c2ecf20Sopenharmony_ci#
6118c2ecf20Sopenharmony_ci# Grouping the document tree into PDF files. List of tuples
6128c2ecf20Sopenharmony_ci# (source start file, target name, title, author, options).
6138c2ecf20Sopenharmony_ci#
6148c2ecf20Sopenharmony_ci# See the Sphinx chapter of https://ralsina.me/static/manual.pdf
6158c2ecf20Sopenharmony_ci#
6168c2ecf20Sopenharmony_ci# FIXME: Do not add the index file here; the result will be too big. Adding
6178c2ecf20Sopenharmony_ci# multiple PDF files here actually tries to get the cross-referencing right
6188c2ecf20Sopenharmony_ci# *between* PDF files.
6198c2ecf20Sopenharmony_cipdf_documents = [
6208c2ecf20Sopenharmony_ci    ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'),
6218c2ecf20Sopenharmony_ci]
6228c2ecf20Sopenharmony_ci
6238c2ecf20Sopenharmony_ci# kernel-doc extension configuration for running Sphinx directly (e.g. by Read
6248c2ecf20Sopenharmony_ci# the Docs). In a normal build, these are supplied from the Makefile via command
6258c2ecf20Sopenharmony_ci# line arguments.
6268c2ecf20Sopenharmony_cikerneldoc_bin = '../scripts/kernel-doc'
6278c2ecf20Sopenharmony_cikerneldoc_srctree = '..'
6288c2ecf20Sopenharmony_ci
6298c2ecf20Sopenharmony_ci# ------------------------------------------------------------------------------
6308c2ecf20Sopenharmony_ci# Since loadConfig overwrites settings from the global namespace, it has to be
6318c2ecf20Sopenharmony_ci# the last statement in the conf.py file
6328c2ecf20Sopenharmony_ci# ------------------------------------------------------------------------------
6338c2ecf20Sopenharmony_ciloadConfig(globals())
634