From nobody Thu Oct 9 02:54:19 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23121192D83; Sun, 22 Jun 2025 06:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750572172; cv=none; b=arQAFMyss1T2DJRN91U7kHrmdjzQAJq9ZzkJ2w1r6gHyxoWQ519fnZKNkn28kDV9jUqElOzuInw+1LGHfWx9KfkNtyLYWn8Kd0qS+kgcACt7tJ71j6iUZrqCUoRMfOe/ZUoHCXUvCWovo6DOBxGLo0ppxNA1hwvPb48pnSSxpq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750572172; c=relaxed/simple; bh=Qmmi8Gl3DNYe5BW7ZlNJcJLLiiwo57HKRdyY+HHucDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CZ53IHmHnwUNvMBYivPoEjAS9gHfzj5Qyc7/SdrKmKr6v+Hby1+CfrCAVA1jt3JkmEOXoLSmw1Ly4TWZ1vQ1jv5lXYXSYet5pThnLxH5cR8wCEOHvtwDLNotawBQpJH0yEWdKyqyHE3r71RZUz2f4TrubPE4TWm4vjb4zenvO5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KMev0JB1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KMev0JB1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 640D8C4AF0B; Sun, 22 Jun 2025 06:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750572171; bh=Qmmi8Gl3DNYe5BW7ZlNJcJLLiiwo57HKRdyY+HHucDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KMev0JB1yOEUS+FT+ncqpKlQ4tljbqhbzZo+qlqEICpIrkq/rxCYzvcFb6wxVb1PP mMYJkSQLypNhL296lDB82zwcG0zVIPMhaHPRLe+rhrVRmKM+G13OBhIWV8SzGnc9Jl UG/+c8VTHyuSoPycjCQvT04IvLkNElAR4uWqUAzEpYkm5G3ICWa3nY93ZzmkZ60Uy2 4dW75kHrr3wxJEWOJMUZEc3T+KZhC0MEUgTv0HK1hb1BkKw2+KM9nOMrt5hHVTxFZy khlvGBJTTYKM4gsCxuYHyeh1qDdq/64gKt7/g1uPTTWRmTK1nYtCFP8m+PLfa9hgS7 331EaP7kGIDlA== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uTDmz-00000000o2u-2jl5; Sun, 22 Jun 2025 08:02:49 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Akira Yokosawa" , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v3 14/15] docs: conf.py: several coding style fixes Date: Sun, 22 Jun 2025 08:02:43 +0200 Message-ID: <063c106d96e86ca30c3266f7819f30b7247881ed.1750571906.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab conf.py is missing a SPDX header and doesn't really have a proper python coding style. It also has an obsolete commented LaTeX syntax that doesn't work anymore. Clean it up a little bit with some help from autolints and manual adjustments. Signed-off-by: Mauro Carvalho Chehab --- Documentation/conf.py | 351 +++++++++++++++++++++--------------------- 1 file changed, 172 insertions(+), 179 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index 91ce2b1c33cc..700516238d3f 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -1,24 +1,28 @@ -# -*- coding: utf-8 -*- -# -# The Linux Kernel documentation build configuration file, created by -# sphinx-quickstart on Fri Feb 12 13:51:46 2016. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# SPDX-License-Identifier: GPL-2.0-only +# pylint: disable=3DC0103,C0209 + +""" +The Linux Kernel documentation build configuration file. +""" =20 -import sys import os -import sphinx import shutil +import sys + +import sphinx + +# If extensions (or modules to document with autodoc) are in another direc= tory, +# add these directories to sys.path here. If the directory is relative to = the +# documentation root, use os.path.abspath to make it absolute, like shown = here. +sys.path.insert(0, os.path.abspath("sphinx")) + +from load_config import loadConfig # pylint: disable=3DC0413= ,E0401 + +# Minimal supported version +needs_sphinx =3D "3.4.3" =20 # Get Sphinx version -major, minor, patch =3D sphinx.version_info[:3] +major, minor, patch =3D sphinx.version_info[:3] # pylint: disable= =3DI1101 =20 # Include_patterns were added on Sphinx 5.1 if (major < 5) or (major =3D=3D 5 and minor < 1): @@ -26,23 +30,22 @@ if (major < 5) or (major =3D=3D 5 and minor < 1): else: has_include_patterns =3D True # Include patterns that don't contain directory names, in glob format - include_patterns =3D ['**.rst'] + include_patterns =3D ["**.rst"] =20 # Location of Documentation/ directory -doctree =3D os.path.abspath('.') +doctree =3D os.path.abspath(".") =20 # Exclude of patterns that don't contain directory names, in glob format. exclude_patterns =3D [] =20 # List of patterns that contain directory names in glob format. dyn_include_patterns =3D [] -dyn_exclude_patterns =3D ['output'] +dyn_exclude_patterns =3D ["output"] =20 # Properly handle include/exclude patterns # ---------------------------------------- =20 def update_patterns(app, config): - """ On Sphinx, all directories are relative to what it is passed as SOURCEDIR parameter for sphinx-build. Due to that, all patterns @@ -53,15 +56,12 @@ def update_patterns(app, config): exclude relative patterns that start with "../". """ =20 - sourcedir =3D app.srcdir # full path to the source directory - builddir =3D os.environ.get("BUILDDIR") - # setup include_patterns dynamically if has_include_patterns: for p in dyn_include_patterns: full =3D os.path.join(doctree, p) =20 - rel_path =3D os.path.relpath(full, start =3D app.srcdir) + rel_path =3D os.path.relpath(full, start=3Dapp.srcdir) if rel_path.startswith("../"): continue =20 @@ -71,15 +71,17 @@ def update_patterns(app, config): for p in dyn_exclude_patterns: full =3D os.path.join(doctree, p) =20 - rel_path =3D os.path.relpath(full, start =3D app.srcdir) + rel_path =3D os.path.relpath(full, start=3Dapp.srcdir) if rel_path.startswith("../"): continue =20 config.exclude_patterns.append(rel_path) =20 + # helper # ------ =20 + def have_command(cmd): """Search ``cmd`` in the ``PATH`` environment. =20 @@ -88,24 +90,23 @@ def have_command(cmd): """ return shutil.which(cmd) is not None =20 -# If extensions (or modules to document with autodoc) are in another direc= tory, -# add these directories to sys.path here. If the directory is relative to = the -# documentation root, use os.path.abspath to make it absolute, like shown = here. -sys.path.insert(0, os.path.abspath('sphinx')) -from load_config import loadConfig =20 # -- General configuration ------------------------------------------------ =20 -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx =3D '3.4.3' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions =3D ['kerneldoc', 'rstFlatTable', 'kernel_include', - 'kfigure', 'sphinx.ext.ifconfig', 'automarkup', - 'maintainers_include', 'sphinx.ext.autosectionlabel', - 'kernel_abi', 'kernel_feat', 'translations'] +# Add any Sphinx extensions in alphabetic order +extensions =3D [ + "automarkup", + "kernel_abi", + "kerneldoc", + "kernel_feat", + "kernel_include", + "kfigure", + "maintainers_include", + "rstFlatTable", + "sphinx.ext.autosectionlabel", + "sphinx.ext.ifconfig", + "translations", +] =20 # Since Sphinx version 3, the C function parser is more pedantic with rega= rds # to type checking. Due to that, having macros at c:function cause problem= s. @@ -180,28 +181,28 @@ autosectionlabel_maxdepth =3D 2 # Load math renderer: # For html builder, load imgmath only when its dependencies are met. # mathjax is the default math renderer since Sphinx 1.8. -have_latex =3D have_command('latex') -have_dvipng =3D have_command('dvipng') +have_latex =3D have_command("latex") +have_dvipng =3D have_command("dvipng") load_imgmath =3D have_latex and have_dvipng =20 # Respect SPHINX_IMGMATH (for html docs only) -if 'SPHINX_IMGMATH' in os.environ: - env_sphinx_imgmath =3D os.environ['SPHINX_IMGMATH'] - if 'yes' in env_sphinx_imgmath: +if "SPHINX_IMGMATH" in os.environ: + env_sphinx_imgmath =3D os.environ["SPHINX_IMGMATH"] + if "yes" in env_sphinx_imgmath: load_imgmath =3D True - elif 'no' in env_sphinx_imgmath: + elif "no" in env_sphinx_imgmath: load_imgmath =3D False else: sys.stderr.write("Unknown env SPHINX_IMGMATH=3D%s ignored.\n" % en= v_sphinx_imgmath) =20 if load_imgmath: extensions.append("sphinx.ext.imgmath") - math_renderer =3D 'imgmath' + math_renderer =3D "imgmath" else: - math_renderer =3D 'mathjax' + math_renderer =3D "mathjax" =20 # Add any paths that contain templates here, relative to this directory. -templates_path =3D ['sphinx/templates'] +templates_path =3D ["sphinx/templates"] =20 # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -209,15 +210,15 @@ templates_path =3D ['sphinx/templates'] source_suffix =3D '.rst' =20 # The encoding of source files. -#source_encoding =3D 'utf-8-sig' +# source_encoding =3D 'utf-8-sig' =20 # The master toctree document. -master_doc =3D 'index' +master_doc =3D "index" =20 # General information about the project. -project =3D 'The Linux Kernel' -copyright =3D 'The kernel development community' -author =3D 'The kernel development community' +project =3D "The Linux Kernel" +copyright =3D "The kernel development community" # pylint: disable= =3DW0622 +author =3D "The kernel development community" =20 # The version info for the project you're documenting, acts as replacement= for # |version| and |release|, also used in various other places throughout the @@ -232,82 +233,86 @@ author =3D 'The kernel development community' try: makefile_version =3D None makefile_patchlevel =3D None - for line in open('../Makefile'): - key, val =3D [x.strip() for x in line.split('=3D', 2)] - if key =3D=3D 'VERSION': - makefile_version =3D val - elif key =3D=3D 'PATCHLEVEL': - makefile_patchlevel =3D val - if makefile_version and makefile_patchlevel: - break -except: + with open("../Makefile", encoding=3D"utf=3D8") as fp: + for line in fp: + key, val =3D [x.strip() for x in line.split("=3D", 2)] + if key =3D=3D "VERSION": + makefile_version =3D val + elif key =3D=3D "PATCHLEVEL": + makefile_patchlevel =3D val + if makefile_version and makefile_patchlevel: + break +except Exception: pass finally: if makefile_version and makefile_patchlevel: - version =3D release =3D makefile_version + '.' + makefile_patchlev= el + version =3D release =3D makefile_version + "." + makefile_patchlev= el else: version =3D release =3D "unknown version" =20 -# -# HACK: there seems to be no easy way for us to get at the version and -# release information passed in from the makefile...so go pawing through t= he -# command-line options and find it for ourselves. -# + def get_cline_version(): - c_version =3D c_release =3D '' + """ + HACK: There seems to be no easy way for us to get at the version and + release information passed in from the makefile...so go pawing through= the + command-line options and find it for ourselves. + """ + + c_version =3D c_release =3D "" for arg in sys.argv: - if arg.startswith('version=3D'): + if arg.startswith("version=3D"): c_version =3D arg[8:] - elif arg.startswith('release=3D'): + elif arg.startswith("release=3D"): c_release =3D arg[8:] if c_version: if c_release: - return c_version + '-' + c_release + return c_version + "-" + c_release return c_version - return version # Whatever we came up with before + return version # Whatever we came up with before + =20 # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language =3D 'en' +language =3D "en" =20 # There are two options for replacing |today|: either, you set today to so= me # non-false value, then it is used: -#today =3D '' +# today =3D '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt =3D '%B %d, %Y' +# today_fmt =3D '%B %d, %Y' =20 # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role =3D None +# default_role =3D None =20 # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses =3D True +# add_function_parentheses =3D True =20 # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names =3D True +# add_module_names =3D True =20 # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors =3D False +# show_authors =3D False =20 # The name of the Pygments (syntax highlighting) style to use. -pygments_style =3D 'sphinx' +pygments_style =3D "sphinx" =20 # A list of ignored prefixes for module index sorting. -#modindex_common_prefix =3D [] +# modindex_common_prefix =3D [] =20 # If true, keep warnings as "system message" paragraphs in the built docum= ents. -#keep_warnings =3D False +# keep_warnings =3D False =20 # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos =3D False =20 -primary_domain =3D 'c' -highlight_language =3D 'none' +primary_domain =3D "c" +highlight_language =3D "none" =20 # -- Options for HTML output ---------------------------------------------- =20 @@ -315,43 +320,45 @@ highlight_language =3D 'none' # a list of builtin themes. =20 # Default theme -html_theme =3D 'alabaster' +html_theme =3D "alabaster" html_css_files =3D [] =20 if "DOCS_THEME" in os.environ: html_theme =3D os.environ["DOCS_THEME"] =20 -if html_theme =3D=3D 'sphinx_rtd_theme' or html_theme =3D=3D 'sphinx_rtd_d= ark_mode': +if html_theme in ["sphinx_rtd_theme", "sphinx_rtd_dark_mode"]: # Read the Docs theme try: import sphinx_rtd_theme + html_theme_path =3D [sphinx_rtd_theme.get_html_theme_path()] =20 # Add any paths that contain custom static files (such as style sh= eets) here, # relative to this directory. They are copied after the builtin st= atic files, # so a file named "default.css" will overwrite the builtin "defaul= t.css". html_css_files =3D [ - 'theme_overrides.css', + "theme_overrides.css", ] =20 # Read the Docs dark mode override theme - if html_theme =3D=3D 'sphinx_rtd_dark_mode': + if html_theme =3D=3D "sphinx_rtd_dark_mode": try: - import sphinx_rtd_dark_mode - extensions.append('sphinx_rtd_dark_mode') + import sphinx_rtd_dark_mode # pylint: disable= =3DW0611 + + extensions.append("sphinx_rtd_dark_mode") except ImportError: - html_theme =3D=3D 'sphinx_rtd_theme' + html_theme =3D "sphinx_rtd_theme" =20 - if html_theme =3D=3D 'sphinx_rtd_theme': - # Add color-specific RTD normal mode - html_css_files.append('theme_rtd_colors.css') + if html_theme =3D=3D "sphinx_rtd_theme": + # Add color-specific RTD normal mode + html_css_files.append("theme_rtd_colors.css") =20 html_theme_options =3D { - 'navigation_depth': -1, + "navigation_depth": -1, } =20 except ImportError: - html_theme =3D 'alabaster' + html_theme =3D "alabaster" =20 if "DOCS_CSS" in os.environ: css =3D os.environ["DOCS_CSS"].split(" ") @@ -359,14 +366,14 @@ if "DOCS_CSS" in os.environ: for l in css: html_css_files.append(l) =20 -if html_theme =3D=3D 'alabaster': +if html_theme =3D=3D "alabaster": html_theme_options =3D { - 'description': get_cline_version(), - 'page_width': '65em', - 'sidebar_width': '15em', - 'fixed_sidebar': 'true', - 'font_size': 'inherit', - 'font_family': 'serif', + "description": get_cline_version(), + "page_width": "65em", + "sidebar_width": "15em", + "fixed_sidebar": "true", + "font_size": "inherit", + "font_family": "serif", } =20 sys.stderr.write("Using %s theme\n" % html_theme) @@ -374,104 +381,79 @@ sys.stderr.write("Using %s theme\n" % html_theme) # Add any paths that contain custom static files (such as style sheets) he= re, # relative to this directory. They are copied after the builtin static fil= es, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path =3D ['sphinx-static'] +html_static_path =3D ["sphinx-static"] =20 # If true, Docutils "smart quotes" will be used to convert quotes and dash= es # to typographically correct entities. However, conversion of "--" to "= =E2=80=94" # is not always what we want, so enable only quotes. -smartquotes_action =3D 'q' +smartquotes_action =3D "q" =20 # Custom sidebar templates, maps document names to template names. # Note that the RTD theme ignores this -html_sidebars =3D { '**': ['searchbox.html', 'kernel-toc.html', 'sourcelin= k.html']} +html_sidebars =3D {"**": ["searchbox.html", + "kernel-toc.html", + "sourcelink.html"]} =20 # about.html is available for alabaster theme. Add it at the front. -if html_theme =3D=3D 'alabaster': - html_sidebars['**'].insert(0, 'about.html') +if html_theme =3D=3D "alabaster": + html_sidebars["**"].insert(0, "about.html") =20 # The name of an image file (relative to this directory) to place at the t= op # of the sidebar. -html_logo =3D 'images/logo.svg' +html_logo =3D "images/logo.svg" =20 # Output file base name for HTML help builder. -htmlhelp_basename =3D 'TheLinuxKerneldoc' +htmlhelp_basename =3D "TheLinuxKerneldoc" =20 # -- Options for LaTeX output --------------------------------------------- =20 latex_elements =3D { # The paper size ('letterpaper' or 'a4paper'). - 'papersize': 'a4paper', - + "papersize": "a4paper", # The font size ('10pt', '11pt' or '12pt'). - 'pointsize': '11pt', - + "pointsize": "11pt", # Latex figure (float) alignment - #'figure_align': 'htbp', - + # 'figure_align': 'htbp', # Don't mangle with UTF-8 chars - 'inputenc': '', - 'utf8extra': '', - + "inputenc": "", + "utf8extra": "", # Set document margins - 'sphinxsetup': ''' + "sphinxsetup": """ hmargin=3D0.5in, vmargin=3D1in, parsedliteralwraps=3Dtrue, verbatimhintsturnover=3Dfalse, - ''', - + """, # # Some of our authors are fond of deep nesting; tell latex to # cope. # - 'maxlistdepth': '10', - + "maxlistdepth": "10", # For CJK One-half spacing, need to be in front of hyperref - 'extrapackages': r'\usepackage{setspace}', - + "extrapackages": r"\usepackage{setspace}", # Additional stuff for the LaTeX preamble. - 'preamble': ''' + "preamble": """ % Use some font with UTF-8 support with XeLaTeX \\usepackage{fontspec} \\setsansfont{DejaVu Sans} \\setromanfont{DejaVu Serif} \\setmonofont{DejaVu Sans Mono} - ''', + """, } =20 # Load kerneldoc specific LaTeX settings -latex_elements['preamble'] +=3D ''' +latex_elements["preamble"] +=3D """ % Load kerneldoc specific LaTeX settings - \\input{kerneldoc-preamble.sty} -''' - -# With Sphinx 1.6, it is possible to change the Bg color directly -# by using: -# \definecolor{sphinxnoteBgColor}{RGB}{204,255,255} -# \definecolor{sphinxwarningBgColor}{RGB}{255,204,204} -# \definecolor{sphinxattentionBgColor}{RGB}{255,255,204} -# \definecolor{sphinximportantBgColor}{RGB}{192,255,204} -# -# However, it require to use sphinx heavy box with: -# -# \renewenvironment{sphinxlightbox} {% -# \\begin{sphinxheavybox} -# } -# \\end{sphinxheavybox} -# } -# -# Unfortunately, the implementation is buggy: if a note is inside a -# table, it isn't displayed well. So, for now, let's use boring -# black and white notes. + \\input{kerneldoc-preamble.sty} +""" =20 # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). # Sorted in alphabetical order -latex_documents =3D [ -] +latex_documents =3D [] =20 # Add all other index files from Documentation/ subdirectories -for fn in os.listdir('.'): +for fn in os.listdir("."): doc =3D os.path.join(fn, "index") if os.path.exists(doc + ".rst"): has =3D False @@ -480,34 +462,39 @@ for fn in os.listdir('.'): has =3D True break if not has: - latex_documents.append((doc, fn + '.tex', - 'Linux %s Documentation' % fn.capitali= ze(), - 'The kernel development community', - 'manual')) + latex_documents.append( + ( + doc, + fn + ".tex", + "Linux %s Documentation" % fn.capitalize(), + "The kernel development community", + "manual", + ) + ) =20 # The name of an image file (relative to this directory) to place at the t= op of # the title page. -#latex_logo =3D None +# latex_logo =3D None =20 # For "manual" documents, if this is true, then toplevel headings are part= s, # not chapters. -#latex_use_parts =3D False +# latex_use_parts =3D False =20 # If true, show page references after internal links. -#latex_show_pagerefs =3D False +# latex_show_pagerefs =3D False =20 # If true, show URL addresses after external links. -#latex_show_urls =3D False +# latex_show_urls =3D False =20 # Documents to append as an appendix to all manuals. -#latex_appendices =3D [] +# latex_appendices =3D [] =20 # If false, no module index is generated. -#latex_domain_indices =3D True +# latex_domain_indices =3D True =20 # Additional LaTeX stuff to be copied to build directory latex_additional_files =3D [ - 'sphinx/kerneldoc-preamble.sty', + "sphinx/kerneldoc-preamble.sty", ] =20 =20 @@ -516,12 +503,11 @@ latex_additional_files =3D [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages =3D [ - (master_doc, 'thelinuxkernel', 'The Linux Kernel Documentation', - [author], 1) + (master_doc, "thelinuxkernel", "The Linux Kernel Documentation", [auth= or], 1) ] =20 # If true, show URL addresses after external links. -#man_show_urls =3D False +# man_show_urls =3D False =20 =20 # -- Options for Texinfo output ------------------------------------------- @@ -529,11 +515,15 @@ man_pages =3D [ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) -texinfo_documents =3D [ - (master_doc, 'TheLinuxKernel', 'The Linux Kernel Documentation', - author, 'TheLinuxKernel', 'One line description of project.', - 'Miscellaneous'), -] +texinfo_documents =3D [( + master_doc, + "TheLinuxKernel", + "The Linux Kernel Documentation", + author, + "TheLinuxKernel", + "One line description of project.", + "Miscellaneous", + ),] =20 # -- Options for Epub output ---------------------------------------------- =20 @@ -544,9 +534,9 @@ epub_publisher =3D author epub_copyright =3D copyright =20 # A list of files that should not be packed into the epub file. -epub_exclude_files =3D ['search.html'] +epub_exclude_files =3D ["search.html"] =20 -#=3D=3D=3D=3D=3D=3D=3D +# =3D=3D=3D=3D=3D=3D=3D # rst2pdf # # Grouping the document tree into PDF files. List of tuples @@ -558,14 +548,14 @@ epub_exclude_files =3D ['search.html'] # multiple PDF files here actually tries to get the cross-referencing right # *between* PDF files. pdf_documents =3D [ - ('kernel-documentation', u'Kernel', u'Kernel', u'J. Random Bozo'), + ("kernel-documentation", "Kernel", "Kernel", "J. Random Bozo"), ] =20 # kernel-doc extension configuration for running Sphinx directly (e.g. by = Read # the Docs). In a normal build, these are supplied from the Makefile via c= ommand # line arguments. -kerneldoc_bin =3D '../scripts/kernel-doc.py' -kerneldoc_srctree =3D '..' +kerneldoc_bin =3D "../scripts/kernel-doc.py" +kerneldoc_srctree =3D ".." =20 # ------------------------------------------------------------------------= ------ # Since loadConfig overwrites settings from the global namespace, it has t= o be @@ -573,5 +563,8 @@ kerneldoc_srctree =3D '..' # ------------------------------------------------------------------------= ------ loadConfig(globals()) =20 + def setup(app): + """Patterns need to be updated at init time on older Sphinx versions""" + app.connect('config-inited', update_patterns) --=20 2.49.0