github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/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 = 'latest' 29 if environ.get('READTHEDOCS_VERSION') is not None: 30 rtd_tag = os.environ['READTHEDOCS_VERSION'] 31 32 placeholder_replacements = { 33 "{BRANCH}" : "main", 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'main' 87 # The full version, including alpha/beta/rc tags. 88 release = u'main' 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 html_style = 'css/custom.css' 130 131 def placeholderReplace(app, docname, source): 132 result = source[0] 133 for key in app.config.placeholder_replacements: 134 result = result.replace(key, app.config.placeholder_replacements[key]) 135 source[0] = result 136 137 138 def setup(app): 139 app.add_config_value('placeholder_replacements', {}, True) 140 app.connect('source-read', placeholderReplace) 141 142 # -- Options for HTMLHelp output ------------------------------------------ 143 144 # Output file base name for HTML help builder. 145 htmlhelp_basename = 'hyperledger-fabricdocsdoc' 146 147 148 # -- Options for LaTeX output --------------------------------------------- 149 150 latex_elements = { 151 # The paper size ('letterpaper' or 'a4paper'). 152 # 153 # 'papersize': 'letterpaper', 154 155 # The font size ('10pt', '11pt' or '12pt'). 156 # 157 # 'pointsize': '10pt', 158 159 # Additional stuff for the LaTeX preamble. 160 # 161 # 'preamble': '', 162 163 # Latex figure (float) alignment 164 # 165 # 'figure_align': 'htbp', 166 } 167 168 # Grouping the document tree into LaTeX files. List of tuples 169 # (source start file, target name, title, 170 # author, documentclass [howto, manual, or own class]). 171 latex_documents = [ 172 (master_doc, 'hyperledger-fabricdocs.tex', u'hyperledger-fabricdocs Documentation', 173 u'hyperledger', 'manual'), 174 ] 175 176 177 # -- Options for manual page output --------------------------------------- 178 179 # One entry per manual page. List of tuples 180 # (source start file, name, description, authors, manual section). 181 man_pages = [ 182 (master_doc, 'hyperledger-fabricdocs', u'hyperledger-fabricdocs Documentation', 183 [author], 1) 184 ] 185 186 187 # -- Options for Texinfo output ------------------------------------------- 188 189 # Grouping the document tree into Texinfo files. List of tuples 190 # (source start file, target name, title, author, 191 # dir menu entry, description, category) 192 texinfo_documents = [ 193 (master_doc, 'hyperledger-fabricdocs', u'hyperledger-fabricdocs Documentation', 194 author, 'hyperledger-fabricdocs', 'One line description of project.', 195 'Miscellaneous'), 196 ] 197 198 199 200 # -- Options for Epub output ---------------------------------------------- 201 202 # Bibliographic Dublin Core info. 203 epub_title = project 204 epub_author = author 205 epub_publisher = author 206 epub_copyright = copyright 207 208 # The unique identifier of the text. This can be a ISBN number 209 # or the project homepage. 210 # 211 # epub_identifier = '' 212 213 # A unique identification for the text. 214 # 215 # epub_uid = '' 216 217 # A list of files that should not be packed into the epub file. 218 epub_exclude_files = ['search.html'] 219 220 # Example configuration for intersphinx: refer to the Python standard library. 221 intersphinx_mapping = {'https://docs.python.org/': None} 222 223 # Skip the links with anchor tags during the linkcheck 224 linkcheck_anchors = False 225 226 # Increase the linkcheck timeout to 5 seconds 227 linkcheck_timeout = 5