-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconf.py
208 lines (182 loc) · 6.38 KB
/
conf.py
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
import sphinx.application
from pygments.lexers.data import JsonLexer
from pygments.lexer import using
import os
# UAM lexer, to be moved in a separate file if possible.
from pygments.lexer import RegexLexer
from pygments.token import *
class uam_lexer(RegexLexer):
name = 'UAM'
aliases = ['uam']
filenames = ['*.uam']
tokens = {
'root': [
(r'//.*?$', Comment.Singleline),
(r"scope|def", Name.Builtin),
(r"if", Name.Builtin),
(r"[rde]'[a-zA-Z0-9_]+(\[[a-zA-Z0-9_]+\])*(\.[a-zA-Z0-9_]+(\[[a-zA-Z0-9_]+\])*)*", Name.Variable),
(r"[a-zA-Z0-9_]+", Name.Constant),
(r'0x[0-9A-Fa-f]+', Token.Literal),
(r'[0-9]+.[0-9]+f', Token.Literal),
(r'[0-9]+', Token.Literal),
(r"/|<|>|&|or|%|-|==", Operator.Word),
(r"\*\*?", Operator.Word),
(r"=", Operator),
(r"\+", Operator.Word),
(r"\|", Operator.Word),
(r"i:", Generic.Emph),
(r"c:", Generic.Emph),
(r"undefined", Name.Variable.Magic),
(r"chain_reaction", Generic.Heading),
(r"clear_desired", Generic.Heading),
(r"create_attributes", Generic.Heading),
(r"common_parent_type", Generic.Heading),
(r"fn_[a-zA-Z0-9_]+", Name.Function),
(r'\s+', Text),
(r'.', Text),
]
}
# MQTT Lexer
class mqtt_lexer(RegexLexer):
name = 'MQTT'
aliases = ['mqtt']
filenames = ['*.mqtt']
tokens = {
'root': [
(r'//.*?$', Comment.Singleline),
(r'#.*?$', Comment.Singleline),
(r"^[a-zA-Z0-9_/\-<>+#]+", Operator.Word),
(r'\{', Text, 'json-object'),
(r'.', Text),
],
'json-object': [
(r'\}', Text, '#pop'),
(r'\{', Text, '#push'),
(r'[^\{\}]*|\n', using(JsonLexer)),
]
}
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Z-Wave-Protocol-Controller"
copyright = "Copyright © 2025 Silicon Laboratories. All rights reserved."
author = "Silicon Labs"
language = "en"
root_doc = "doc/protocol/zwave/zpc_introduction"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
html_additional_pages = {'index': 'index.html'}
extensions = [
"breathe",
"myst_parser",
"sphinxcontrib.plantuml",
"sphinx.ext.githubpages",
"sphinx_markdown_tables"
]
templates_path = ["_templates"]
exclude_patterns = ["_build",
"Thumbs.db",
".DS_Store",
"**internal.md", "**/libs/cmock",
"components/testframework",
"**zwave_command_classes/README.md",
"**vscode-extension**",
"**dmt_match_generator**",
"**zw-libs2**",
"**uic-resources**",
"**dotdot-xml**",
"build**",
"LICENSE.md",
"README.md",
"**node_modules**",
"**uic_attribute_mapper/src/README.md",
"scripts/ci",
"scripts/sd_card",
"**release_notes.md",
"externals",
"**build_**",
"unify-spec",
"scripts/ci",
"**applications/uhab**",
"**cc_template.**"]
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
# enable all markdown features of the myst parser
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]
# setup plantuml plugin, fallback to LSB location
plantuml = os.environ.get("PLANTUML_JAR_PATH", "/usr/share/plantuml/plantuml.jar")
plantuml = "java -jar " + plantuml
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_js_files = ["js/charenc.js", "js/crypt.js", "js/sha1.js", "js/html5-qrcode.min.js", "js/qr_code_scanner.js"]
html_css_files = ["custom_styles.css"]
html_logo = "doxygen/assets/silicon-labs-logo.png"
html_title = "Z-Wave-Protocol-Controller"
html_baseurl = "https://SiliconLabsSoftware.github.io/z-wave-protocol-controller"
releases_github_path = "SiliconLabsSoftware/z-wave-protocol-controller"
# -- Options for figures and tables (https://www.sphinx-doc.org/en/master/usage/configuration.html)
numfig = True
numfig_format = dict()
numfig_format['figure'] = 'Figure %s'
numfig_format['table'] = 'Table %s'
numfig_format['code-block'] = 'Listing %s'
numfig_format['section'] = 'Section %s'
# -- Options for LaTeX output ------------------------------------------------
latex_engine = "lualatex"
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# I just also aded "oneside", this string is just copied into the \documentclass[] content
#
"papersize": "a4paper,oneside",
# The font size ('10pt', '11pt' or '12pt').
#
"pointsize": "10pt",
# Latex figure (float) alignment
#
"figure_align": "H",
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
root_doc,
"unify_sdk_documentation.tex",
"Unify Framework documentation",
"Silicon Labs",
"howto",
),
(
"doc/unify_specifications/index",
"unify_specifications.tex",
"Unify Specifications",
"Silicon Labs",
"howto",
),
]
# Logo
latex_logo = "./doxygen/assets/silicon-labs-logo.png"
def setup(app: sphinx.application.Sphinx):
app.add_lexer('uam', uam_lexer)
app.add_lexer('mqtt', mqtt_lexer)