github.com/hyperledger/fabric-ca@v2.0.0-alpha.0.20201120210307-7b4f34729db1+incompatible/docs/source/conf.py (about)

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