10
10
import os
11
11
import sys
12
12
from os import environ
13
- sys .path .insert (0 , os .path .abspath ('.' ))
13
+
14
+ sys .path .insert (0 , os .path .abspath ("." ))
14
15
15
16
import sphinx_rtd_theme
16
17
17
- rtd_tag = ' latest'
18
- if environ .get (' READTHEDOCS_VERSION' ) is not None :
19
- rtd_tag = os .environ [' READTHEDOCS_VERSION' ]
18
+ rtd_tag = " latest"
19
+ if environ .get (" READTHEDOCS_VERSION" ) is not None :
20
+ rtd_tag = os .environ [" READTHEDOCS_VERSION" ]
20
21
21
22
22
23
placeholder_replacements = {
23
24
"{BRANCH}" : "main" ,
24
- "{BRANCH_DOC}" : "latest" , # Used to target the correct ReadTheDocs distribution version
25
- "{RTD_TAG}" : rtd_tag
25
+ "{BRANCH_DOC}" : "latest" , # Used to target the correct ReadTheDocs distribution version
26
+ "{RTD_TAG}" : rtd_tag ,
26
27
}
27
28
28
29
# -- Project information -----------------------------------------------------
29
30
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
30
31
31
- project = u' Hyperledger Fabric Docs'
32
- copyright = u' 2017-2024, Hyperledger Foundation'
33
- author = u' Hyperledger Foundation'
34
- release = u' main'
35
- version = u' main'
32
+ project = " Hyperledger Fabric Docs"
33
+ copyright = " 2017-2024, Hyperledger Foundation"
34
+ author = " Hyperledger Foundation"
35
+ release = " main"
36
+ version = " main"
36
37
37
38
# -- General configuration ---------------------------------------------------
38
39
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
46
47
# Sphinx projects.
47
48
# Installed version as per directive in docs/requirement.txt
48
49
source_parsers = {
49
- ' .md' : ' recommonmark.parser.CommonMarkParser' ,
50
+ " .md" : " recommonmark.parser.CommonMarkParser" ,
50
51
}
51
52
52
- # The file extensions of source files. Sphinx considers the files with this suffix as sources.
53
+ # The file extensions of source files. Sphinx considers the files with this suffix as sources.
53
54
# The value can be a dictionary mapping file extensions to file types. For example:
54
- source_suffix = {
55
- '.rst' : 'restructuredtext' ,
56
- '.md' : 'markdown'
57
- }
55
+ source_suffix = {".rst" : "restructuredtext" , ".md" : "markdown" }
58
56
59
57
# Add any paths that contain templates here, relative to this directory.
60
- templates_path = [' _templates' ]
58
+ templates_path = [" _templates" ]
61
59
62
60
# List of patterns, relative to source directory, that match files and
63
61
# directories to ignore when looking for source files.
64
62
# This patterns also effect to html_static_path and html_extra_path
65
- exclude_patterns = [' _build' , ' Thumbs.db' , ' .DS_Store' ]
63
+ exclude_patterns = [" _build" , " Thumbs.db" , " .DS_Store" ]
66
64
67
65
# Used to be "master_doc"
68
66
# The main toctree document
69
- root_doc = ' index'
67
+ root_doc = " index"
70
68
71
69
# The name of the Pygments (syntax highlighting) style to use.
72
- pygments_style = ' sphinx'
70
+ pygments_style = " sphinx"
73
71
74
72
# If true, `todo` and `todoList` produce output, else they produce nothing.
75
73
todo_include_todos = True
76
74
77
- extensions = ['sphinx.ext.autodoc' ,
78
- 'sphinx.ext.doctest' ,
79
- 'sphinx.ext.intersphinx' ,
80
- 'sphinx.ext.todo' ,
81
- 'sphinx.ext.imgmath' ,
82
- 'sphinx.ext.ifconfig' ,
83
- 'sphinx.ext.viewcode' ,
84
- 'myst_parser' ,
85
- 'sphinxcontrib.jquery' ]
75
+ extensions = [
76
+ "sphinx.ext.autodoc" ,
77
+ "sphinx.ext.doctest" ,
78
+ "sphinx.ext.intersphinx" ,
79
+ "sphinx.ext.todo" ,
80
+ "sphinx.ext.imgmath" ,
81
+ "sphinx.ext.ifconfig" ,
82
+ "sphinx.ext.viewcode" ,
83
+ "myst_parser" ,
84
+ "sphinxcontrib.jquery" ,
85
+ "sphinx_tabs.tabs" ,
86
+ ]
86
87
87
88
# -- Special API Accesses -------------------------------------------------
88
89
# They create an instance of the Sphinx object, documented here
91
92
#
92
93
# We then call it to perform special/specific customizations.
93
94
95
+
94
96
def placeholderReplace (app , docname , source ):
95
97
result = source [0 ]
96
98
for key in app .config .placeholder_replacements :
97
99
result = result .replace (key , app .config .placeholder_replacements [key ])
98
100
source [0 ] = result
99
101
102
+
100
103
def setup (app ):
101
- app .add_css_file (' css/custom.css' )
102
- app .add_config_value (' placeholder_replacements' , {}, True )
103
- app .connect (' source-read' , placeholderReplace )
104
+ app .add_css_file (" css/custom.css" )
105
+ app .add_config_value (" placeholder_replacements" , {}, True )
106
+ app .connect (" source-read" , placeholderReplace )
104
107
105
108
106
109
# -- Options for HTML output -------------------------------------------------
107
110
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
108
111
109
- html_theme = ' sphinx_rtd_theme'
112
+ html_theme = " sphinx_rtd_theme"
110
113
111
114
# html_css_files = ['css/custom.css']
112
115
113
116
html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
114
117
115
- html_static_path = [' _static' ]
118
+ html_static_path = [" _static" ]
116
119
117
120
html_add_permalinks = True
118
121
119
122
# -- MyST-specific Options -------------------------------------------------
120
123
# https://myst-parser.readthedocs.io/en/latest/configuration.html#sphinx-config-options
121
- myst_all_links_external = True
124
+ myst_all_links_external = True
0 commit comments