1
- # -*- coding: utf-8 -*-
2
1
#
3
2
# Full list of options at http://www.sphinx-doc.org/en/master/config
4
3
10
9
#
11
10
import os
12
11
import sys
13
- import catkin_pkg .package
14
12
13
+ import catkin_pkg .package
15
14
from exhale import utils
16
15
17
16
package_dir = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
18
17
catkin_package = catkin_pkg .package .parse_package (
19
- os .path .join (package_dir , catkin_pkg .package .PACKAGE_MANIFEST_FILENAME ))
18
+ os .path .join (package_dir , catkin_pkg .package .PACKAGE_MANIFEST_FILENAME )
19
+ )
20
20
sys .path .insert (0 , os .path .abspath (os .path .join (package_dir , "src" )))
21
21
22
22
23
23
# -- Helper functions --------------------------------------------------------
24
24
25
+
25
26
def count_files ():
26
27
""":returns tuple of (num_py, num_cpp)"""
27
28
num_py = 0
28
29
num_cpp = 0
29
30
30
- for root , dirs , files in os .walk (os .path .join (package_dir , "src" )):
31
+ for _root , _dirs , files in os .walk (os .path .join (package_dir , "src" )):
31
32
for f in files :
32
33
if f .endswith (".py" ):
33
34
num_py += 1
34
- for root , dirs , files in os .walk (os .path .join (package_dir , "include" )):
35
+ for _root , _dirs , files in os .walk (os .path .join (package_dir , "include" )):
35
36
for f in files :
36
37
if f .endswith (".h" ) or f .endswith (".hpp" ):
37
38
num_cpp += 1
@@ -42,7 +43,7 @@ def count_files():
42
43
# -- Project information -----------------------------------------------------
43
44
44
45
project = catkin_package .name
45
- copyright = ' 2019, Bit-Bots'
46
+ copyright = " 2019, Bit-Bots"
46
47
author = ", " .join ([a .name for a in catkin_package .authors ])
47
48
48
49
# The short X.Y version
@@ -60,27 +61,27 @@ def count_files():
60
61
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
61
62
# ones.
62
63
extensions = [
63
- ' sphinx.ext.autodoc' ,
64
- ' sphinx.ext.doctest' ,
65
- ' sphinx.ext.intersphinx' ,
66
- ' sphinx.ext.todo' ,
67
- ' sphinx.ext.coverage' ,
68
- ' sphinx.ext.imgmath' ,
69
- ' sphinx.ext.viewcode' ,
70
- ' sphinx_rtd_theme' ,
64
+ " sphinx.ext.autodoc" ,
65
+ " sphinx.ext.doctest" ,
66
+ " sphinx.ext.intersphinx" ,
67
+ " sphinx.ext.todo" ,
68
+ " sphinx.ext.coverage" ,
69
+ " sphinx.ext.imgmath" ,
70
+ " sphinx.ext.viewcode" ,
71
+ " sphinx_rtd_theme" ,
71
72
]
72
73
73
74
# Add any paths that contain templates here, relative to this directory.
74
- templates_path = [' _templates' ]
75
+ templates_path = [" _templates" ]
75
76
76
77
# The suffix(es) of source filenames.
77
78
# You can specify multiple suffix as a list of string:
78
79
#
79
80
# source_suffix = ['.rst', '.md']
80
- source_suffix = ' .rst'
81
+ source_suffix = " .rst"
81
82
82
83
# The master toctree document.
83
- master_doc = ' index'
84
+ master_doc = " index"
84
85
85
86
# The language for content autogenerated by Sphinx. Refer to documentation
86
87
# for a list of supported languages.
@@ -92,7 +93,7 @@ def count_files():
92
93
# List of patterns, relative to source directory, that match files and
93
94
# directories to ignore when looking for source files.
94
95
# This pattern also affects html_static_path and html_extra_path.
95
- exclude_patterns = [' _build' , ' Thumbs.db' , ' .DS_Store' ]
96
+ exclude_patterns = [" _build" , " Thumbs.db" , " .DS_Store" ]
96
97
97
98
# The name of the Pygments (syntax highlighting) style to use.
98
99
pygments_style = None
@@ -108,24 +109,17 @@ def count_files():
108
109
109
110
if num_files_cpp > 0 :
110
111
extensions += [
111
- ' breathe' ,
112
- ' exhale' ,
112
+ " breathe" ,
113
+ " exhale" ,
113
114
]
114
115
115
- breathe_projects = {
116
- project : os .path .join ("_build" , "doxyoutput" , "xml" )
117
- }
116
+ breathe_projects = {project : os .path .join ("_build" , "doxyoutput" , "xml" )}
118
117
breathe_default_project = project
119
118
120
119
def specifications_for_kind (kind ):
121
120
# Show all members for classes and structs
122
121
if kind == "class" or kind == "struct" :
123
- return [
124
- ":members:" ,
125
- ":protected-members:" ,
126
- ":private-members:" ,
127
- ":undoc-members:"
128
- ]
122
+ return [":members:" , ":protected-members:" , ":private-members:" , ":undoc-members:" ]
129
123
# An empty list signals to Exhale to use the defaults
130
124
else :
131
125
return []
@@ -136,21 +130,19 @@ def specifications_for_kind(kind):
136
130
"rootFileName" : "library_root.rst" ,
137
131
"rootFileTitle" : "C++ Library API" ,
138
132
"doxygenStripFromPath" : ".." ,
139
- "customSpecificationsMapping" : utils .makeCustomSpecificationsMapping (
140
- specifications_for_kind
141
- ),
133
+ "customSpecificationsMapping" : utils .makeCustomSpecificationsMapping (specifications_for_kind ),
142
134
# Suggested optional arguments
143
135
"createTreeView" : True ,
144
136
"exhaleExecutesDoxygen" : True ,
145
- "exhaleDoxygenStdin" : "INPUT = {}" .format (os .path .join (package_dir , "include" ))
137
+ "exhaleDoxygenStdin" : "INPUT = {}" .format (os .path .join (package_dir , "include" )),
146
138
}
147
139
148
140
# -- Options for HTML output -------------------------------------------------
149
141
150
142
# The theme to use for HTML and HTML Help pages. See the documentation for
151
143
# a list of builtin themes.
152
144
#
153
- html_theme = ' sphinx_rtd_theme'
145
+ html_theme = " sphinx_rtd_theme"
154
146
155
147
# Theme options are theme-specific and customize the look and feel of a theme
156
148
# further. For a list of options available for each theme, see the
@@ -161,7 +153,7 @@ def specifications_for_kind(kind):
161
153
# Add any paths that contain custom static files (such as style sheets) here,
162
154
# relative to this directory. They are copied after the builtin static files,
163
155
# so a file named "default.css" will overwrite the builtin "default.css".
164
- html_static_path = [' _static' ]
156
+ html_static_path = [" _static" ]
165
157
166
158
# Custom sidebar templates, must be a dictionary that maps document names
167
159
# to template names.
@@ -173,21 +165,23 @@ def specifications_for_kind(kind):
173
165
#
174
166
# html_sidebars = {}
175
167
176
- html_logo = os .path .join (' _static' , ' logo.png' )
177
- html_favicon = os .path .join (' _static' , ' logo.png' )
168
+ html_logo = os .path .join (" _static" , " logo.png" )
169
+ html_favicon = os .path .join (" _static" , " logo.png" )
178
170
179
171
180
172
# -- Options for intersphinx extension ---------------------------------------
181
173
182
174
# Example configuration for intersphinx: refer to the Python standard library.
183
- intersphinx_mapping = {' https://docs.python.org/' : None }
175
+ intersphinx_mapping = {" https://docs.python.org/" : None }
184
176
185
177
# -- Options for todo extension ----------------------------------------------
186
178
187
179
# If true, `todo` and `todoList` produce output, else they produce nothing.
188
180
todo_include_todos = True
189
181
190
182
# -- RST Standard variables ---------------------------------------------------
191
- rst_prolog = ".. |project| replace:: {}\n " . format ( project )
183
+ rst_prolog = f ".. |project| replace:: { project } \n "
192
184
rst_prolog += ".. |description| replace:: {}\n " .format (catkin_package .description .replace ("\n \n " , "\n " ))
193
- rst_prolog += ".. |modindex| replace:: {}\n " .format (":ref:`modindex`" if num_files_py > 0 else "Python module index is not available" )
185
+ rst_prolog += ".. |modindex| replace:: {}\n " .format (
186
+ ":ref:`modindex`" if num_files_py > 0 else "Python module index is not available"
187
+ )
0 commit comments