1313# -- Project information -----------------------------------------------------
1414# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1515
16- project = ' Sphinx AutoAPI'
17- copyright = ' 2023, Read the Docs'
18- author = ' Read the Docs'
16+ project = " Sphinx AutoAPI"
17+ copyright = " 2023, Read the Docs"
18+ author = " Read the Docs"
1919version = "." .join (str (x ) for x in autoapi .__version_info__ [:2 ])
2020release = autoapi .__version__
2121
2222# -- General configuration ---------------------------------------------------
2323# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2424
2525extensions = [
26- ' autoapi.extension' ,
27- ' sphinx.ext.intersphinx' ,
28- ' sphinx.ext.napoleon' ,
29- ' sphinx_design' ,
26+ " autoapi.extension" ,
27+ " sphinx.ext.intersphinx" ,
28+ " sphinx.ext.napoleon" ,
29+ " sphinx_design" ,
3030]
3131
32- templates_path = [' _templates' ]
33- exclude_patterns = [' _build' , ' Thumbs.db' , ' .DS_Store' , ' changes/*.rst' ]
32+ templates_path = [" _templates" ]
33+ exclude_patterns = [" _build" , " Thumbs.db" , " .DS_Store" , " changes/*.rst" ]
3434
3535
3636# -- Options for HTML output -------------------------------------------------
3737# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3838
39- html_theme = ' furo'
40- html_static_path = [' _static' ]
41- html_css_files = [' overrides.css' ]
39+ html_theme = " furo"
40+ html_static_path = [" _static" ]
41+ html_css_files = [" overrides.css" ]
4242
4343# -- Options for AutoAPI extension -------------------------------------------
44- autoapi_dirs = [' ../autoapi' ]
44+ autoapi_dirs = [" ../autoapi" ]
4545autoapi_generate_api_docs = False
4646
4747# -- Options for intersphinx extension ---------------------------------------
4848
4949intersphinx_mapping = {
50- ' jinja' : (' https://jinja.palletsprojects.com/en/3.0.x/' , None ),
51- ' sphinx' : (' https://www.sphinx-doc.org/en/master/' , None ),
52- ' python' : (' https://docs.python.org/3/' , None ),
50+ " jinja" : (" https://jinja.palletsprojects.com/en/3.0.x/" , None ),
51+ " sphinx" : (" https://www.sphinx-doc.org/en/master/" , None ),
52+ " python" : (" https://docs.python.org/3/" , None ),
5353}
5454
5555# -- Enable confval and event roles ------------------------------------------
5656
57- event_sig_re = re .compile (r'([a-zA-Z-]+)\s*\((.*)\)' )
57+ event_sig_re = re .compile (r"([a-zA-Z-]+)\s*\((.*)\)" )
58+
5859
5960def parse_event (env , sig , signode ):
6061 m = event_sig_re .match (sig )
@@ -64,18 +65,27 @@ def parse_event(env, sig, signode):
6465 name , args = m .groups ()
6566 signode += addnodes .desc_name (name , name )
6667 plist = addnodes .desc_parameterlist ()
67- for arg in args .split (',' ):
68+ for arg in args .split ("," ):
6869 arg = arg .strip ()
6970 plist += addnodes .desc_parameter (arg , arg )
7071 signode += plist
7172 return name
7273
7374
7475def setup (app ):
75- app .add_object_type ('confval' , 'confval' ,
76- objname = 'configuration value' ,
77- indextemplate = 'pair: %s; configuration value' )
78- fdesc = TypedField ('parameter' , label = 'Parameters' ,
79- names = ('param' ,), typenames = ('type' ,), can_collapse = True )
80- app .add_object_type ('event' , 'event' , 'pair: %s; event' , parse_event ,
81- doc_field_types = [fdesc ])
76+ app .add_object_type (
77+ "confval" ,
78+ "confval" ,
79+ objname = "configuration value" ,
80+ indextemplate = "pair: %s; configuration value" ,
81+ )
82+ fdesc = TypedField (
83+ "parameter" ,
84+ label = "Parameters" ,
85+ names = ("param" ,),
86+ typenames = ("type" ,),
87+ can_collapse = True ,
88+ )
89+ app .add_object_type (
90+ "event" , "event" , "pair: %s; event" , parse_event , doc_field_types = [fdesc ]
91+ )
0 commit comments