[PATCH 4/4] Updates to match Sphinx templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



This should be a no-op commit. It restructures the config file to match
the style and format of the generic config file generated by
sphinx-quickstart. The only reason to do this is to make it easy to
adapt to changes to Sphinx going forward. This commit reflects the
behaviour of Sphinx 1.8.4 which is what is packaged into Debian. The
previous config file was generated by a 1.2.x era of Sphinx.

Signed-off-by: Grant Likely <grant.likely@xxxxxxx>
---
 source/conf.py | 255 +++++++++++++++++--------------------------------
 1 file changed, 86 insertions(+), 169 deletions(-)

diff --git a/source/conf.py b/source/conf.py
index c84edc3..10abaf7 100644
--- a/source/conf.py
+++ b/source/conf.py
@@ -1,26 +1,22 @@
 # -*- coding: utf-8 -*-
 #
 # Devicetree Specification documentation build configuration file, created by
-# sphinx-quickstart on Tue Apr 19 10:28:32 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.
+# This file does only contain a selection of the most common options. For a
+# full list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
 
-import sys
-import os
-import time
-import subprocess
+# -- Path setup --------------------------------------------------------------
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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('.'))
+#
+import os
+import sys
+import time
+import subprocess
+# sys.path.insert(0, os.path.abspath('.'))
 
 sys.path.append(os.path.abspath('extensions'))
 
@@ -30,48 +26,48 @@ def setup(app):
     from sphinx.highlighting import lexers
     lexers['dts'] = DtsLexer()
 
+# -- Project information -----------------------------------------------------
+
+project = u'Devicetree Specification'
+copyright = u'2016,2017, devicetree.org'
+author = u'devicetree.org'
+
+# The short X.Y version
+try:
+    version = str(subprocess.check_output(["git", "describe", "--dirty"]), 'utf-8').strip()
+except:
+    version = "unknown-rev"
+# The full version, including alpha/beta/rc tags
+release = version
 
-# -- General configuration ------------------------------------------------
+
+# -- General configuration ---------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
+#
 needs_sphinx = '1.2.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 = ['sphinx.ext.graphviz', 'numsec']
+extensions = [
+    'sphinx.ext.todo',
+    'sphinx.ext.graphviz',
+    'numsec'
+]
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
 # The suffix(es) of source filenames.
 # You can specify multiple suffix as a list of string:
+#
 # source_suffix = ['.rst', '.md']
 source_suffix = '.rst'
 
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
 # The master toctree document.
 master_doc = 'index'
 
-# General information about the project.
-project = u'Devicetree Specification'
-copyright = u'2016,2017, devicetree.org'
-author = u'devicetree.org'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-try:
-    version = str(subprocess.check_output(["git", "describe", "--dirty"]), 'utf-8').strip()
-except:
-    version = "unknown-rev"
-# The full version, including alpha/beta/rc tags.
-release = version
-
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 #
@@ -87,51 +83,26 @@ today_fmt = '%d %B %Y'
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-# This patterns also effect to html_static_path and html_extra_path
+# This pattern also affects html_static_path and html_extra_path.
 exclude_patterns = []
 
 # Include at the beginning of every source file that is read
 with open('rst_prolog', 'rb') as pr:
     rst_prolog = pr.read().decode('utf-8')
 
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
 
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = False
-
 numfig = True
 
 highlight_language = 'none'
 
 
-# -- Options for HTML output ----------------------------------------------
+# -- Options for HTML output -------------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-import alabaster
-
+#
 html_theme = 'alabaster'
 
 # Theme options are theme-specific and customize the look and feel of a theme
@@ -142,16 +113,6 @@ html_theme_options = {
         'github_repo': 'devicetree-specification',
 }
 
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = [alabaster.get_path()]
-
-# The name for this set of Sphinx documents.
-# "<project> v<release> documentation" by default.
-#html_title = u'Devicetree Specification v0.2-pre2'
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
 # The name of an image file (relative to this directory) to place at the top
 # of the sidebar.
 html_logo = "devicetree-logo.svg"
@@ -166,19 +127,18 @@ html_favicon = "devicetree-favicon.png"
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
+# Custom sidebar templates, must be a dictionary that maps document names
+# to template names.
+#
+# The default sidebars (for documents that don't match any pattern) are
+# defined by theme itself.  Builtin themes are using these templates by
+# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
+# 'searchbox.html']``.
+#
+# html_sidebars = {}
 
-# If not None, a 'Last updated on:' timestamp is inserted at every page
-# bottom, using the given strftime format.
-# The empty string is equivalent to '%b %d, %Y'.
-#html_last_updated_fmt = None
 
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
+# -- Options for HTMLHelp output ---------------------------------------------
 
 # Custom sidebar templates, maps document names to template names.
 html_sidebars = {
@@ -189,70 +149,33 @@ html_sidebars = {
         'searchbox.html',
     ]
 }
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Language to be used for generating the HTML full-text search index.
-# Sphinx supports the following languages:
-#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
-#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
-#html_search_language = 'en'
-
-# A dictionary with options for the search language support, empty by default.
-# 'ja' uses this config value.
-# 'zh' user can custom change `jieba` dictionary path.
-#html_search_options = {'type': 'default'}
-
-# The name of a javascript file (relative to the configuration directory) that
-# implements a search results scorer. If empty, the default will be used.
-#html_search_scorer = 'scorer.js'
 
 # Output file base name for HTML help builder.
 htmlhelp_basename = 'DevicetreeSpecificationdoc'
 
-# -- Options for LaTeX output ---------------------------------------------
+
+# -- Options for LaTeX output ------------------------------------------------
 
 latex_elements = {
-  'classoptions': ',oneside',
-  'babel': '\\usepackage[english]{babel}',
+    'classoptions': ',oneside',
+    'babel': '\\usepackage[english]{babel}',
+    'sphinxsetup': 'hmargin=2cm',
 
-  # The paper size ('letterpaper' or 'a4paper').
-  'papersize': 'a4paper',
+    # The paper size ('letterpaper' or 'a4paper').
+    #
+    'papersize': 'a4paper',
 
-  'sphinxsetup': 'hmargin=2cm',
+    # The font size ('10pt', '11pt' or '12pt').
+    #
+    # 'pointsize': '10pt',
 
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+    # Additional stuff for the LaTeX preamble.
+    #
+    # 'preamble': '',
 
-# Latex figure (float) alignment
-  'figure_align': 'H',
+    # Latex figure (float) alignment
+    #
+    'figure_align': 'H',
 }
 
 # Release numbers with a qualifier (ex. '-rc', '-pre') get a watermark.
@@ -271,24 +194,7 @@ latex_documents = [
 # the title page.
 latex_logo = "devicetree-logo.png"
 
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
+# -- Options for manual page output ------------------------------------------
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
@@ -297,11 +203,8 @@ man_pages = [
      [author], 1)
 ]
 
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
 
-# -- Options for Texinfo output -------------------------------------------
+# -- Options for Texinfo output ----------------------------------------------
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
@@ -312,14 +215,28 @@ texinfo_documents = [
      'Miscellaneous'),
 ]
 
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
 
-# If false, no module index is generated.
-#texinfo_domain_indices = True
+# -- Options for Epub output -------------------------------------------------
 
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
+# Bibliographic Dublin Core info.
+epub_title = project
 
-# If true, do not generate a @detailmenu in the "Top" node's menu.
-#texinfo_no_detailmenu = False
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#
+# epub_identifier = ''
+
+# A unique identification for the text.
+#
+# epub_uid = ''
+
+# A list of files that should not be packed into the epub file.
+epub_exclude_files = ['search.html']
+
+
+# -- Extension configuration -------------------------------------------------
+
+# -- Options for todo extension ----------------------------------------------
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
-- 
2.20.1




[Index of Archives]     [Device Tree]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]

  Powered by Linux