88
99os .environ ['SPHINX_AUTODOC_RELOAD_MODULES' ] = '1'
1010
11- extensions = ['sphinx.ext.autodoc' , 'sphinx.ext.doctest' , 'sphinx.ext.todo' ,
12- 'sphinx.ext.autosummary' , 'sphinx.ext.extlinks' ,
13- 'sphinx.ext.intersphinx' ,
14- 'sphinx.ext.viewcode' , 'sphinx.ext.inheritance_diagram' ,
15- 'sphinx.ext.coverage' ]
11+ extensions = [
12+ 'sphinx.ext.autodoc' ,
13+ 'sphinx.ext.doctest' ,
14+ 'sphinx.ext.todo' ,
15+ 'sphinx.ext.autosummary' ,
16+ 'sphinx.ext.extlinks' ,
17+ 'sphinx.ext.intersphinx' ,
18+ 'sphinx.ext.viewcode' ,
19+ 'sphinx.ext.inheritance_diagram' ,
20+ 'sphinx.ext.coverage' ,
21+ ]
1622coverage_statistics_to_report = coverage_statistics_to_stdout = True
1723templates_path = ['_templates' ]
1824exclude_patterns = ['_build' ]
4955epub_scheme = 'url'
5056epub_identifier = epub_publisher
5157epub_pre_files = [('index.xhtml' , 'Welcome' )]
52- epub_post_files = [('usage/installation.xhtml' , 'Installing Sphinx' ),
53- ('develop.xhtml' , 'Sphinx development' )]
54- epub_exclude_files = ['_static/opensearch.xml' , '_static/doctools.js' ,
55- '_static/searchtools.js' ,
56- '_static/sphinx_highlight.js' ,
57- '_static/basic.css' ,
58- '_static/language_data.js' ,
59- 'search.html' , '_static/websupport.js' ]
58+ epub_post_files = [
59+ ('usage/installation.xhtml' , 'Installing Sphinx' ),
60+ ('develop.xhtml' , 'Sphinx development' ),
61+ ]
62+ epub_exclude_files = [
63+ '_static/opensearch.xml' ,
64+ '_static/doctools.js' ,
65+ '_static/searchtools.js' ,
66+ '_static/sphinx_highlight.js' ,
67+ '_static/basic.css' ,
68+ '_static/language_data.js' ,
69+ 'search.html' ,
70+ '_static/websupport.js' ,
71+ ]
6072epub_fix_images = False
6173epub_max_image_width = 0
6274epub_show_urls = 'inline'
6375epub_use_index = False
6476epub_description = 'Sphinx documentation generator system manual'
6577
66- latex_documents = [('index' , 'sphinx.tex' , 'Sphinx Documentation' ,
67- 'the Sphinx developers' , 'manual' , 1 )]
78+ latex_documents = [
79+ ('index' , 'sphinx.tex' , 'Sphinx Documentation' , 'the Sphinx developers' , 'manual' , 1 )
80+ ]
6881latex_logo = '_static/sphinx.png'
6982latex_elements = {
7083 'fontenc' : r'\usepackage[LGR,X2,T1]{fontenc}' ,
71- 'passoptionstopackages' : r'''
84+ 'passoptionstopackages' : r"""
7285\PassOptionsToPackage{svgnames}{xcolor}
73- ''' ,
74- 'preamble' : r'''
86+ """ ,
87+ 'preamble' : r"""
7588\DeclareUnicodeCharacter{229E}{\ensuremath{\boxplus}}
7689\setcounter{tocdepth}{3}% depth of what main TOC shows (3=subsubsection)
7790\setcounter{secnumdepth}{1}% depth of section numbering
7891\setlength{\tymin}{2cm}% avoid too cramped table columns
79- ''' ,
92+ """ ,
8093 # fix missing index entry due to RTD doing only once pdflatex after makeindex
81- 'printindex' : r'''
94+ 'printindex' : r"""
8295\IfFileExists{\jobname.ind}
8396 {\footnotesize\raggedright\printindex}
8497 {\begin{sphinxtheindex}\end{sphinxtheindex}}
85- ''' ,
98+ """ ,
8699}
87100latex_show_urls = 'footnote'
88101latex_use_xindy = True
92105autodoc_member_order = 'groupwise'
93106autosummary_generate = False
94107todo_include_todos = True
95- extlinks = {'duref' : ('https://docutils.sourceforge.io/docs/ref/rst/'
96- 'restructuredtext.html#%s' , '%s' ),
97- 'durole' : ('https://docutils.sourceforge.io/docs/ref/rst/'
98- 'roles.html#%s' , '%s' ),
99- 'dudir' : ('https://docutils.sourceforge.io/docs/ref/rst/'
100- 'directives.html#%s' , '%s' )}
108+ extlinks = {
109+ 'duref' : (
110+ 'https://docutils.sourceforge.io/docs/ref/rst/' 'restructuredtext.html#%s' ,
111+ '%s' ,
112+ ),
113+ 'durole' : ('https://docutils.sourceforge.io/docs/ref/rst/' 'roles.html#%s' , '%s' ),
114+ 'dudir' : ('https://docutils.sourceforge.io/docs/ref/rst/' 'directives.html#%s' , '%s' ),
115+ }
101116
102117man_pages = [
103- ('index' , 'sphinx-all' , 'Sphinx documentation generator system manual' ,
104- 'the Sphinx developers' , 1 ),
105- ('man/sphinx-build' , 'sphinx-build' , 'Sphinx documentation generator tool' ,
106- '' , 1 ),
107- ('man/sphinx-quickstart' , 'sphinx-quickstart' , 'Sphinx documentation '
108- 'template generator' , '' , 1 ),
109- ('man/sphinx-apidoc' , 'sphinx-apidoc' , 'Sphinx API doc generator tool' ,
110- '' , 1 ),
111- ('man/sphinx-autogen' , 'sphinx-autogen' , 'Generate autodoc stub pages' ,
112- '' , 1 ),
118+ (
119+ 'index' ,
120+ 'sphinx-all' ,
121+ 'Sphinx documentation generator system manual' ,
122+ 'the Sphinx developers' ,
123+ 1 ,
124+ ),
125+ ('man/sphinx-build' , 'sphinx-build' , 'Sphinx documentation generator tool' , '' , 1 ),
126+ (
127+ 'man/sphinx-quickstart' ,
128+ 'sphinx-quickstart' ,
129+ 'Sphinx documentation ' 'template generator' ,
130+ '' ,
131+ 1 ,
132+ ),
133+ ('man/sphinx-apidoc' , 'sphinx-apidoc' , 'Sphinx API doc generator tool' , '' , 1 ),
134+ ('man/sphinx-autogen' , 'sphinx-autogen' , 'Generate autodoc stub pages' , '' , 1 ),
113135]
114136
115137texinfo_documents = [
116- ('index' , 'sphinx' , 'Sphinx Documentation' , 'the Sphinx developers' ,
117- 'Sphinx' , 'The Sphinx documentation builder.' , 'Documentation tools' ,
118- 1 ),
138+ (
139+ 'index' ,
140+ 'sphinx' ,
141+ 'Sphinx Documentation' ,
142+ 'the Sphinx developers' ,
143+ 'Sphinx' ,
144+ 'The Sphinx documentation builder.' ,
145+ 'Documentation tools' ,
146+ 1 ,
147+ ),
119148]
120149
121150intersphinx_mapping = {
129158gettext_compact = False
130159
131160nitpick_ignore = {
132- ('cpp:class' , 'template<typename TOuter> template<typename TInner> Wrapper::Outer<TOuter>::Inner' ), # NoQA: E501
161+ (
162+ 'cpp:class' ,
163+ 'template<typename TOuter> template<typename TInner> Wrapper::Outer<TOuter>::Inner' ,
164+ ), # NoQA: E501
133165 ('cpp:identifier' , 'MyContainer' ),
134166 ('js:func' , 'SomeError' ),
135167 ('js:func' , 'number' ),
@@ -213,13 +245,13 @@ def parse_event(env, sig, signode):
213245def linkify_issues_in_changelog (app , docname , source ):
214246 """Linkify issue references like #123 in changelog to GitHub."""
215247 if docname == 'changes' :
216- changelog_path = os .path .join (os .path .dirname (__file__ ), " ../CHANGES.rst" )
248+ changelog_path = os .path .join (os .path .dirname (__file__ ), ' ../CHANGES.rst' )
217249 # this path trickery is needed because this script can
218250 # be invoked with different working directories:
219251 # * running make in docs/
220252 # * running tox -e docs in the repo root dir
221253
222- with open (changelog_path , encoding = " utf-8" ) as f :
254+ with open (changelog_path , encoding = ' utf-8' ) as f :
223255 changelog = f .read ()
224256
225257 def linkify (match ):
@@ -234,12 +266,16 @@ def linkify(match):
234266def setup (app ):
235267 from sphinx .ext .autodoc import cut_lines
236268 from sphinx .util .docfields import GroupedField
269+
237270 app .connect ('autodoc-process-docstring' , cut_lines (4 , what = ['module' ]))
238271 app .connect ('source-read' , linkify_issues_in_changelog )
239- app .add_object_type ('confval' , 'confval' ,
240- objname = 'configuration value' ,
241- indextemplate = 'pair: %s; configuration value' )
242- fdesc = GroupedField ('parameter' , label = 'Parameters' ,
243- names = ['param' ], can_collapse = True )
244- app .add_object_type ('event' , 'event' , 'pair: %s; event' , parse_event ,
245- doc_field_types = [fdesc ])
272+ app .add_object_type (
273+ 'confval' ,
274+ 'confval' ,
275+ objname = 'configuration value' ,
276+ indextemplate = 'pair: %s; configuration value' ,
277+ )
278+ fdesc = GroupedField ('parameter' , label = 'Parameters' , names = ['param' ], can_collapse = True )
279+ app .add_object_type (
280+ 'event' , 'event' , 'pair: %s; event' , parse_event , doc_field_types = [fdesc ]
281+ )
0 commit comments