Repository navigation
Expand file tree
/
Copy pathconf.py
More file actions
144 lines (127 loc) · 4.01 KB
/
Copy pathconf.py
File metadata and controls
144 lines (127 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# -*- coding: utf-8 -*-
import os
import sys
import logging
from datetime import date
# Global variables
root_path = os.path.abspath(os.path.join("..", ".."))
sys.path.insert(0, root_path)
SITE_URL = "https://docs.bluerobotics.com/ping-python/"
REPO_URL = "https://github.com/bluerobotics/ping-python/"
REPO_NAME = "ping-python"
PROJECT_NAME ="ping-python"
# Project information
project = PROJECT_NAME
copyright = f"{date.today().year} - Blue Robotics Inc"
author = "Blue Robotics contributors"
# General configuration
extensions = [
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.githubpages",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"myst_parser",
"sphinx_blue_robotics_theme",
"sphinx_blue_robotics_theme.extensions.extras",
"sphinx_blue_robotics_theme.extensions.cpp",
"breathe",
"exhale",
]
master_doc = "index"
source_suffix = {'.rst': 'restructuredtext', '.md': 'restructuredtext'}
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "python_api/library_root.rst"]
# Syntax highlighting
pygments_style = "sphinx"
# Substitutions
myst_substitutions = {
"project_name": "Blue Robotics"
}
# External links
extlinks = {
'issue': (REPO_URL + '/issues/%s', 'issue %s')
}
# HTML output configuration
html_theme = "sphinx_blue_robotics_theme"
html_static_path = ["_static"]
html_css_files = ['custom.css']
html_theme_options = {
"site_url": SITE_URL,
"repo_url": REPO_URL,
"repo_name": REPO_NAME,
"icon": {
"repo": "fontawesome/brands/github",
"edit": "material/file-edit-outline",
},
"globaltoc_collapse": False,
"edit_uri": "blob/master/docs/source",
"features": [
"navigation.sections",
"navigation.megamenu",
"navigation.top",
"toc.follow",
"toc.sticky",
"content.tabs.link",
"announce.dismiss",
],
"palette": [
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"toggle": {
"icon": "octicons/moon-16",
"name": "Switch to dark mode",
}
},
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"toggle": {
"icon": "octicons/sun-16",
"name": "Switch to light mode",
}
},
],
"toc_title_is_page_title": True,
}
html_last_updated_fmt = "%d %b %Y"
htmlhelp_basename = "BlueRoboticsDocumentationdoc"
html_baseurl = SITE_URL
html_context = {
"homepage_url": "https://bluerobotics.com",
"project_url": html_baseurl,
"project": project,
"exclude_comments": True
}
# Breathe and Exhale configuration
breathe_projects = {project: os.path.join(root_path, "doc", "xml")}
breathe_default_project = project
breathe_domain_by_extension = {"h": "cpp", "py": "py"}
# Silence doxygen warnings
suppress_warnings = [
"ref.duplicate", # Suppress warnings about duplicate references
"app.add_directive", # Suppress warnings about directives
"autodoc.duplicate_object_description", # Suppress warnings about duplicate object descriptions
]
exhale_args = {
"containmentFolder": "./python_api",
"rootFileName": "library_root.rst",
"doxygenStripFromPath": root_path,
"rootFileTitle": "API Reference",
"createTreeView": False,
"contentsDirectives": False,
"exhaleExecutesDoxygen": True,
"fullToctreeMaxDepth": 1,
"exhaleDoxygenStdin": f"INPUT = {os.path.join(root_path, 'brping')}",
"verboseBuild": True,
}
# Myst Parser options
myst_enable_extensions = ["substitution", "colon_fence"]
def setup(app):
# Suppress Breathe duplicate object & parameter mismatch warnings
logger = logging.getLogger("sphinx")
logger.addFilter(lambda record: "duplicate object description" not in record.getMessage())
logger.addFilter(lambda record: "does not match any of the parameters" not in record.getMessage())