1- # -*- coding: utf-8 -*-
21#
32# Full list of options at http://www.sphinx-doc.org/en/master/config
43
109#
1110import os
1211import sys
13- import catkin_pkg .package
1412
13+ import catkin_pkg .package
1514from exhale import utils
1615
1716package_dir = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
1817catkin_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+ )
2020sys .path .insert (0 , os .path .abspath (os .path .join (package_dir , "src" )))
2121
2222
2323# -- Helper functions --------------------------------------------------------
2424
25+
2526def count_files ():
2627 """:returns tuple of (num_py, num_cpp)"""
2728 num_py = 0
@@ -42,7 +43,7 @@ def count_files():
4243# -- Project information -----------------------------------------------------
4344
4445project = catkin_package .name
45- copyright = ' 2019, Bit-Bots'
46+ copyright = " 2019, Bit-Bots"
4647author = ", " .join ([a .name for a in catkin_package .authors ])
4748
4849# The short X.Y version
@@ -60,27 +61,27 @@ def count_files():
6061# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
6162# ones.
6263extensions = [
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" ,
7172]
7273
7374# Add any paths that contain templates here, relative to this directory.
74- templates_path = [' _templates' ]
75+ templates_path = [" _templates" ]
7576
7677# The suffix(es) of source filenames.
7778# You can specify multiple suffix as a list of string:
7879#
7980# source_suffix = ['.rst', '.md']
80- source_suffix = ' .rst'
81+ source_suffix = " .rst"
8182
8283# The master toctree document.
83- master_doc = ' index'
84+ master_doc = " index"
8485
8586# The language for content autogenerated by Sphinx. Refer to documentation
8687# for a list of supported languages.
@@ -92,7 +93,7 @@ def count_files():
9293# List of patterns, relative to source directory, that match files and
9394# directories to ignore when looking for source files.
9495# 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" ]
9697
9798# The name of the Pygments (syntax highlighting) style to use.
9899pygments_style = None
@@ -108,24 +109,17 @@ def count_files():
108109
109110if num_files_cpp > 0 :
110111 extensions += [
111- ' breathe' ,
112- ' exhale' ,
112+ " breathe" ,
113+ " exhale" ,
113114 ]
114115
115- breathe_projects = {
116- project : os .path .join ("_build" , "doxyoutput" , "xml" )
117- }
116+ breathe_projects = {project : os .path .join ("_build" , "doxyoutput" , "xml" )}
118117 breathe_default_project = project
119118
120119 def specifications_for_kind (kind ):
121120 # Show all members for classes and structs
122121 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:" ]
129123 # An empty list signals to Exhale to use the defaults
130124 else :
131125 return []
@@ -136,21 +130,19 @@ def specifications_for_kind(kind):
136130 "rootFileName" : "library_root.rst" ,
137131 "rootFileTitle" : "C++ Library API" ,
138132 "doxygenStripFromPath" : ".." ,
139- "customSpecificationsMapping" : utils .makeCustomSpecificationsMapping (
140- specifications_for_kind
141- ),
133+ "customSpecificationsMapping" : utils .makeCustomSpecificationsMapping (specifications_for_kind ),
142134 # Suggested optional arguments
143135 "createTreeView" : True ,
144136 "exhaleExecutesDoxygen" : True ,
145- "exhaleDoxygenStdin" : "INPUT = {}" .format (os .path .join (package_dir , "include" ))
137+ "exhaleDoxygenStdin" : "INPUT = {}" .format (os .path .join (package_dir , "include" )),
146138 }
147139
148140# -- Options for HTML output -------------------------------------------------
149141
150142# The theme to use for HTML and HTML Help pages. See the documentation for
151143# a list of builtin themes.
152144#
153- html_theme = ' sphinx_rtd_theme'
145+ html_theme = " sphinx_rtd_theme"
154146
155147# Theme options are theme-specific and customize the look and feel of a theme
156148# further. For a list of options available for each theme, see the
@@ -161,7 +153,7 @@ def specifications_for_kind(kind):
161153# Add any paths that contain custom static files (such as style sheets) here,
162154# relative to this directory. They are copied after the builtin static files,
163155# so a file named "default.css" will overwrite the builtin "default.css".
164- html_static_path = [' _static' ]
156+ html_static_path = [" _static" ]
165157
166158# Custom sidebar templates, must be a dictionary that maps document names
167159# to template names.
@@ -173,21 +165,23 @@ def specifications_for_kind(kind):
173165#
174166# html_sidebars = {}
175167
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" )
178170
179171
180172# -- Options for intersphinx extension ---------------------------------------
181173
182174# 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 }
184176
185177# -- Options for todo extension ----------------------------------------------
186178
187179# If true, `todo` and `todoList` produce output, else they produce nothing.
188180todo_include_todos = True
189181
190182# -- RST Standard variables ---------------------------------------------------
191- rst_prolog = ".. |project| replace:: {}\n " . format ( project )
183+ rst_prolog = f ".. |project| replace:: { project } \n "
192184rst_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