github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/docs/source/conf.py (about)

     1  # -*- coding: utf-8 -*-
     2  #
     3  # SPDX-License-Identifier: Apache-2.0
     4  #
     5  # hyperledger-fabricdocs documentation build configuration file, created by
     6  # sphinx-quickstart on Mon Feb 20 16:11:53 2017.
     7  #
     8  # This file is execfile()d with the current directory set to its
     9  # containing dir.
    10  #
    11  # Note that not all possible configuration values are present in this
    12  # autogenerated file.
    13  #
    14  # All configuration values have a default; values that are commented out
    15  # serve to show the default.
    16  
    17  # If extensions (or modules to document with autodoc) are in another directory,
    18  # add these directories to sys.path here. If the directory is relative to the
    19  # documentation root, use os.path.abspath to make it absolute, like shown here.
    20  #
    21  import os
    22  import sys
    23  import sphinx_rtd_theme
    24  from os import environ
    25  
    26  sys.path.insert(0, os.path.abspath('.'))
    27  
    28  rtd_tag = 'release-2.2'
    29  if environ.get('READTHEDOCS_VERSION') is not None:
    30      rtd_tag = os.environ['READTHEDOCS_VERSION']
    31  
    32  placeholder_replacements = {
    33      "{BRANCH}" : "release-2.2",
    34      "{BRANCH_DOC}" : "latest", # Used to target the correct ReadTheDocs distribution version
    35      "{RTD_TAG}": rtd_tag
    36  }
    37  
    38  # -- General configuration ------------------------------------------------
    39  
    40  # If your documentation needs a minimal Sphinx version, state it here.
    41  #
    42  # needs_sphinx = '1.0'
    43  
    44  # Add any Sphinx extension module names here, as strings. They can be
    45  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
    46  # ones.
    47  extensions = ['sphinx.ext.autodoc',
    48      'sphinx.ext.doctest',
    49      'sphinx.ext.intersphinx',
    50      'sphinx.ext.todo',
    51      'sphinx.ext.imgmath',
    52      'sphinx.ext.ifconfig',
    53      'sphinx.ext.viewcode']
    54  
    55  # Add any paths that contain templates here, relative to this directory.
    56  templates_path = ['_templates']
    57  
    58  # recommonmark is a python utility that allows markdown to be used within
    59  # Sphinx projects.
    60  # Installed version as per directive in docs/requirement.txt
    61  from recommonmark.parser import CommonMarkParser
    62  
    63  source_parsers = {
    64      '.md': CommonMarkParser,
    65  }
    66  
    67  # The suffix(es) of source filenames.
    68  # You can specify multiple suffix as a list of string:
    69  #
    70  # source_suffix = ['.rst', '.md']
    71  source_suffix = ['.rst', '.md']
    72  
    73  # The master toctree document.
    74  master_doc = 'index'
    75  
    76  # General information about the project.
    77  project = u'hyperledger-fabricdocs'
    78  copyright = u'2017, hyperledger'
    79  author = u'hyperledger'
    80  
    81  # The version info for the project you're documenting, acts as replacement for
    82  # |version| and |release|, also used in various other places throughout the
    83  # built documents.
    84  #
    85  # The short X.Y version.
    86  version = u'master'
    87  # The full version, including alpha/beta/rc tags.
    88  release = u'master'
    89  
    90  # The language for content autogenerated by Sphinx. Refer to documentation
    91  # for a list of supported languages.
    92  #
    93  # This is also used if you do content translation via gettext catalogs.
    94  # Usually you set "language" from the command line for these cases.
    95  language = None
    96  
    97  # List of patterns, relative to source directory, that match files and
    98  # directories to ignore when looking for source files.
    99  # This patterns also effect to html_static_path and html_extra_path
   100  exclude_patterns = []
   101  
   102  # The name of the Pygments (syntax highlighting) style to use.
   103  pygments_style = 'sphinx'
   104  
   105  # If true, `todo` and `todoList` produce output, else they produce nothing.
   106  todo_include_todos = True
   107  
   108  
   109  # -- Options for HTML output ----------------------------------------------
   110  
   111  # The theme to use for HTML and HTML Help pages.  See the documentation for
   112  # a list of builtin themes.
   113  #
   114  html_theme = 'sphinx_rtd_theme'
   115  
   116  html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
   117  
   118  # Theme options are theme-specific and customize the look and feel of a theme
   119  # further.  For a list of options available for each theme, see the
   120  # documentation.
   121  #
   122  # html_theme_options = {}
   123  
   124  # Add any paths that contain custom static files (such as style sheets) here,
   125  # relative to this directory. They are copied after the builtin static files,
   126  # so a file named "default.css" will overwrite the builtin "default.css".
   127  html_static_path = ['_static']
   128  
   129  def placeholderReplace(app, docname, source):
   130      result = source[0]
   131      for key in app.config.placeholder_replacements:
   132          result = result.replace(key, app.config.placeholder_replacements[key])
   133      source[0] = result
   134  
   135  
   136  def setup(app):
   137      app.add_stylesheet('css/custom.css')
   138      app.add_config_value('placeholder_replacements', {}, True)
   139      app.connect('source-read', placeholderReplace)
   140  
   141  # -- Options for HTMLHelp output ------------------------------------------
   142  
   143  # Output file base name for HTML help builder.
   144  htmlhelp_basename = 'hyperledger-fabricdocsdoc'
   145  
   146  
   147  # -- Options for LaTeX output ---------------------------------------------
   148  
   149  latex_elements = {
   150      # The paper size ('letterpaper' or 'a4paper').
   151      #
   152      # 'papersize': 'letterpaper',
   153  
   154      # The font size ('10pt', '11pt' or '12pt').
   155      #
   156      # 'pointsize': '10pt',
   157  
   158      # Additional stuff for the LaTeX preamble.
   159      #
   160      # 'preamble': '',
   161  
   162      # Latex figure (float) alignment
   163      #
   164      # 'figure_align': 'htbp',
   165  }
   166  
   167  # Grouping the document tree into LaTeX files. List of tuples
   168  # (source start file, target name, title,
   169  #  author, documentclass [howto, manual, or own class]).
   170  latex_documents = [
   171      (master_doc, 'hyperledger-fabricdocs.tex', u'hyperledger-fabricdocs Documentation',
   172       u'hyperledger', 'manual'),
   173  ]
   174  
   175  
   176  # -- Options for manual page output ---------------------------------------
   177  
   178  # One entry per manual page. List of tuples
   179  # (source start file, name, description, authors, manual section).
   180  man_pages = [
   181      (master_doc, 'hyperledger-fabricdocs', u'hyperledger-fabricdocs Documentation',
   182       [author], 1)
   183  ]
   184  
   185  
   186  # -- Options for Texinfo output -------------------------------------------
   187  
   188  # Grouping the document tree into Texinfo files. List of tuples
   189  # (source start file, target name, title, author,
   190  #  dir menu entry, description, category)
   191  texinfo_documents = [
   192      (master_doc, 'hyperledger-fabricdocs', u'hyperledger-fabricdocs Documentation',
   193       author, 'hyperledger-fabricdocs', 'One line description of project.',
   194       'Miscellaneous'),
   195  ]
   196  
   197  
   198  
   199  # -- Options for Epub output ----------------------------------------------
   200  
   201  # Bibliographic Dublin Core info.
   202  epub_title = project
   203  epub_author = author
   204  epub_publisher = author
   205  epub_copyright = copyright
   206  
   207  # The unique identifier of the text. This can be a ISBN number
   208  # or the project homepage.
   209  #
   210  # epub_identifier = ''
   211  
   212  # A unique identification for the text.
   213  #
   214  # epub_uid = ''
   215  
   216  # A list of files that should not be packed into the epub file.
   217  epub_exclude_files = ['search.html']
   218  
   219  # Example configuration for intersphinx: refer to the Python standard library.
   220  intersphinx_mapping = {'https://docs.python.org/': None}
   221  
   222  # Skip the links with anchor tags during the linkcheck
   223  linkcheck_anchors = False
   224  
   225  # Increase the linkcheck timeout to 5 seconds
   226  linkcheck_timeout = 5