13
13
# -- Project information -----------------------------------------------------
14
14
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
15
15
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"
19
19
version = "." .join (str (x ) for x in autoapi .__version_info__ [:2 ])
20
20
release = autoapi .__version__
21
21
22
22
# -- General configuration ---------------------------------------------------
23
23
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
24
24
25
25
extensions = [
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" ,
30
30
]
31
31
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" ]
34
34
35
35
36
36
# -- Options for HTML output -------------------------------------------------
37
37
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
38
38
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" ]
42
42
43
43
# -- Options for AutoAPI extension -------------------------------------------
44
- autoapi_dirs = [' ../autoapi' ]
44
+ autoapi_dirs = [" ../autoapi" ]
45
45
autoapi_generate_api_docs = False
46
46
47
47
# -- Options for intersphinx extension ---------------------------------------
48
48
49
49
intersphinx_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 ),
53
53
}
54
54
55
55
# -- Enable confval and event roles ------------------------------------------
56
56
57
- event_sig_re = re .compile (r'([a-zA-Z-]+)\s*\((.*)\)' )
57
+ event_sig_re = re .compile (r"([a-zA-Z-]+)\s*\((.*)\)" )
58
+
58
59
59
60
def parse_event (env , sig , signode ):
60
61
m = event_sig_re .match (sig )
@@ -64,18 +65,27 @@ def parse_event(env, sig, signode):
64
65
name , args = m .groups ()
65
66
signode += addnodes .desc_name (name , name )
66
67
plist = addnodes .desc_parameterlist ()
67
- for arg in args .split (',' ):
68
+ for arg in args .split ("," ):
68
69
arg = arg .strip ()
69
70
plist += addnodes .desc_parameter (arg , arg )
70
71
signode += plist
71
72
return name
72
73
73
74
74
75
def 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