|
17 | 17 | # If extensions (or modules to document with autodoc) are in another directory, |
18 | 18 | # add these directories to sys.path here. If the directory is relative to the |
19 | 19 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
20 | | -sys.path.insert(0, os.path.abspath('ext')) |
| 20 | +sys.path.insert(0, os.path.abspath("ext")) |
21 | 21 |
|
22 | 22 | # -- General configuration ----------------------------------------------------- |
23 | 23 |
|
24 | 24 | # If your documentation needs a minimal Sphinx version, state it here. |
25 | | -#needs_sphinx = '1.0' |
| 25 | +# needs_sphinx = '1.0' |
26 | 26 |
|
27 | 27 | # Add any Sphinx extension module names here, as strings. They can be extensions |
28 | 28 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
29 | | -extensions += ['zeek', 'sphinx.ext.todo', 'zeek_pygments', 'spicy-pygments', 'literal-emph'] |
30 | | -extensions += ['sphinx.ext.extlinks'] |
| 29 | +extensions += [ |
| 30 | + "zeek", |
| 31 | + "sphinx.ext.todo", |
| 32 | + "zeek_pygments", |
| 33 | + "spicy-pygments", |
| 34 | + "literal-emph", |
| 35 | +] |
| 36 | +extensions += ["sphinx.ext.extlinks"] |
31 | 37 |
|
32 | 38 | # Add any paths that contain templates here, relative to this directory. |
33 | | -templates_path = ['_templates'] |
| 39 | +templates_path = ["_templates"] |
34 | 40 |
|
35 | 41 | # The suffix of source filenames. |
36 | | -source_suffix = '.rst' |
| 42 | +source_suffix = ".rst" |
37 | 43 |
|
38 | 44 | # The encoding of source files. |
39 | | -#source_encoding = 'utf-8-sig' |
| 45 | +# source_encoding = 'utf-8-sig' |
40 | 46 |
|
41 | 47 | # The master toctree document. |
42 | | -master_doc = 'index' |
| 48 | +master_doc = "index" |
43 | 49 |
|
44 | 50 | # General information about the project. |
45 | | -project = 'Zeek' |
46 | | -copyright = '2019-2023, The Zeek Project' |
| 51 | +project = "Zeek" |
| 52 | +copyright = "2019-2023, The Zeek Project" |
47 | 53 |
|
48 | 54 | # The version info for the project you're documenting, acts as replacement for |
49 | 55 | # |version| and |release|, also used in various other places throughout the |
|
56 | 62 |
|
57 | 63 | try: |
58 | 64 | # Use the actual Zeek version if available |
59 | | - with open('../VERSION') as f: |
| 65 | + with open("../VERSION") as f: |
60 | 66 | version = f.readline().strip() |
61 | 67 | except: |
62 | 68 | try: |
63 | 69 | import re |
64 | 70 |
|
65 | 71 | import git |
66 | 72 |
|
67 | | - repo = git.Repo(os.path.abspath('.')) |
| 73 | + repo = git.Repo(os.path.abspath(".")) |
68 | 74 | version = "git/master" |
69 | 75 |
|
70 | | - version_tag_re = r'v\d+\.\d+(\.\d+)?' |
71 | | - version_tags = [t for t in repo.tags if |
72 | | - t.commit == repo.head.commit and |
73 | | - re.match(version_tag_re, str(t)) |
74 | | - ] |
| 76 | + version_tag_re = r"v\d+\.\d+(\.\d+)?" |
| 77 | + version_tags = [ |
| 78 | + t |
| 79 | + for t in repo.tags |
| 80 | + if t.commit == repo.head.commit and re.match(version_tag_re, str(t)) |
| 81 | + ] |
75 | 82 | # Note: sorting by tag date doesn't necessarily give correct |
76 | 83 | # order in terms of version numbers, but doubtful that will ever be |
77 | 84 | # a problem (if we ever do re-tag an old version number on a given |
|
100 | 107 | # `release/.*`, and the tip of those branches will always be in sync with |
101 | 108 | # auto-generated content by simply having `zeek/ci/update-zeekygen-docs.sh` |
102 | 109 | # change this to `release/.*` when needed. |
103 | | -zeek_code_version = 'master' |
104 | | -zeek_code_url = f'https://github.com/zeek/zeek/blob/{zeek_code_version}' |
| 110 | +zeek_code_version = "master" |
| 111 | +zeek_code_url = f"https://github.com/zeek/zeek/blob/{zeek_code_version}" |
105 | 112 |
|
106 | 113 | # The language for content autogenerated by Sphinx. Refer to documentation |
107 | 114 | # for a list of supported languages. |
108 | | -#language = None |
| 115 | +# language = None |
109 | 116 |
|
110 | 117 | # There are two options for replacing |today|: either, you set today to some |
111 | 118 | # non-false value, then it is used: |
112 | | -#today = '' |
| 119 | +# today = '' |
113 | 120 | # Else, today_fmt is used as the format for a strftime call. |
114 | | -today_fmt = '%B %d, %Y' |
| 121 | +today_fmt = "%B %d, %Y" |
115 | 122 |
|
116 | 123 | # List of patterns, relative to source directory, that match files and |
117 | 124 | # directories to ignore when looking for source files. |
118 | | -exclude_patterns = [".#*", 'script-reference/autogenerated-*'] |
| 125 | +exclude_patterns = [".#*", "script-reference/autogenerated-*"] |
119 | 126 |
|
120 | 127 | # The reST default role (used for this markup: `text`) to use for all documents. |
121 | | -#default_role = None |
| 128 | +# default_role = None |
122 | 129 |
|
123 | 130 | # If true, '()' will be appended to :func: etc. cross-reference text. |
124 | | -#add_function_parentheses = True |
| 131 | +# add_function_parentheses = True |
125 | 132 |
|
126 | 133 | # If true, the current module name will be prepended to all description |
127 | 134 | # unit titles (such as .. function::). |
128 | | -#add_module_names = True |
| 135 | +# add_module_names = True |
129 | 136 |
|
130 | 137 | # If true, sectionauthor and moduleauthor directives will be shown in the |
131 | 138 | # output. They are ignored by default. |
132 | 139 | show_authors = True |
133 | 140 |
|
134 | 141 | # The name of the Pygments (syntax highlighting) style to use. |
135 | | -pygments_style = 'sphinx' |
| 142 | +pygments_style = "sphinx" |
136 | 143 |
|
137 | | -highlight_language = 'none' |
| 144 | +highlight_language = "none" |
138 | 145 |
|
139 | 146 | # A list of ignored prefixes for module index sorting. |
140 | | -#modindex_common_prefix = [] |
| 147 | +# modindex_common_prefix = [] |
141 | 148 |
|
142 | 149 |
|
143 | 150 | # -- Options for HTML output --------------------------------------------------- |
144 | 151 |
|
145 | | -html_theme = 'sphinx_rtd_theme' |
| 152 | +html_theme = "sphinx_rtd_theme" |
146 | 153 |
|
147 | 154 | # Set canonical URL from the Read the Docs Domain |
148 | 155 | html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") |
|
153 | 160 | html_context = {} |
154 | 161 | html_context["READTHEDOCS"] = True |
155 | 162 |
|
156 | | -html_last_updated_fmt = '%B %d, %Y' |
| 163 | +html_last_updated_fmt = "%B %d, %Y" |
157 | 164 |
|
158 | 165 | # Theme options are theme-specific and customize the look and feel of a theme |
159 | 166 | # further. For a list of options available for each theme, see the |
160 | 167 | # documentation. |
161 | 168 | html_theme_options = { |
162 | | - 'analytics_id': 'UA-144186885-1', |
163 | | - 'collapse_navigation': False, |
164 | | - 'display_version': True, |
| 169 | + "analytics_id": "UA-144186885-1", |
| 170 | + "collapse_navigation": False, |
| 171 | + "display_version": True, |
165 | 172 | "style_external_links": True, |
166 | 173 | } |
167 | 174 |
|
168 | 175 | # Add any paths that contain custom themes here, relative to this directory. |
169 | | -#html_theme_path = [] |
| 176 | +# html_theme_path = [] |
170 | 177 |
|
171 | 178 | # The name for this set of Sphinx documents. If None, it defaults to |
172 | 179 | # "<project> v<release> Documentation". |
173 | | -html_title = f'Book of Zeek ({release})' |
| 180 | +html_title = f"Book of Zeek ({release})" |
174 | 181 |
|
175 | 182 | # A shorter title for the navigation bar. Default is the same as html_title. |
176 | | -#html_short_title = None |
| 183 | +# html_short_title = None |
177 | 184 |
|
178 | 185 | # The name of an image file (relative to this directory) to place at the top |
179 | 186 | # of the sidebar. |
180 | | -html_logo = 'images/zeek-logo-sidebar.png' |
| 187 | +html_logo = "images/zeek-logo-sidebar.png" |
181 | 188 |
|
182 | 189 | # The name of an image file (within the static path) to use as favicon of the |
183 | 190 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
184 | 191 | # pixels large. |
185 | | -html_favicon = 'images/zeek-favicon.ico' |
| 192 | +html_favicon = "images/zeek-favicon.ico" |
186 | 193 |
|
187 | 194 | # Add any paths that contain custom static files (such as style sheets) here, |
188 | 195 | # relative to this directory. They are copied after the builtin static files, |
189 | 196 | # so a file named "default.css" will overwrite the builtin "default.css". |
190 | | -html_static_path = ['_static'] |
| 197 | +html_static_path = ["_static"] |
| 198 | + |
191 | 199 |
|
192 | 200 | def setup(app): |
193 | 201 | app.add_css_file("theme_overrides.css") |
194 | 202 | from sphinx.highlighting import lexers |
195 | 203 | from zeek_pygments import ZeekLexer |
196 | | - lexers['zeek'] = ZeekLexer() |
197 | | - app.add_config_value('zeek-code-url', zeek_code_url, 'env') |
| 204 | + |
| 205 | + lexers["zeek"] = ZeekLexer() |
| 206 | + app.add_config_value("zeek-code-url", zeek_code_url, "env") |
| 207 | + |
198 | 208 |
|
199 | 209 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
200 | 210 | # using the given strftime format. |
201 | | -#html_last_updated_fmt = '%b %d, %Y' |
| 211 | +# html_last_updated_fmt = '%b %d, %Y' |
202 | 212 |
|
203 | 213 | # If true, SmartyPants will be used to convert quotes and dashes to |
204 | 214 | # typographically correct entities. |
205 | | -#html_use_smartypants = True |
| 215 | +# html_use_smartypants = True |
206 | 216 |
|
207 | 217 | # Custom sidebar templates, maps document names to template names. |
208 | | -#html_sidebars = { |
| 218 | +# html_sidebars = { |
209 | 219 | #'**': ['localtoc.html', 'sourcelink.html', 'searchbox.html'], |
210 | | -#} |
| 220 | +# } |
211 | 221 |
|
212 | 222 | # Additional templates that should be rendered to pages, maps page names to |
213 | 223 | # template names. |
214 | | -#html_additional_pages = {} |
| 224 | +# html_additional_pages = {} |
215 | 225 |
|
216 | 226 | # If false, no module index is generated. |
217 | | -#html_domain_indices = True |
| 227 | +# html_domain_indices = True |
218 | 228 |
|
219 | 229 | # If false, no index is generated. |
220 | | -#html_use_index = True |
| 230 | +# html_use_index = True |
221 | 231 |
|
222 | 232 | # If true, the index is split into individual pages for each letter. |
223 | | -#html_split_index = False |
| 233 | +# html_split_index = False |
224 | 234 |
|
225 | 235 | # If true, links to the reST sources are added to the pages. |
226 | | -#html_show_sourcelink = True |
| 236 | +# html_show_sourcelink = True |
227 | 237 |
|
228 | 238 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
229 | | -#html_show_sphinx = True |
| 239 | +# html_show_sphinx = True |
230 | 240 |
|
231 | 241 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
232 | | -#html_show_copyright = True |
| 242 | +# html_show_copyright = True |
233 | 243 |
|
234 | 244 | # If true, an OpenSearch description file will be output, and all pages will |
235 | 245 | # contain a <link> tag referring to it. The value of this option must be the |
236 | 246 | # base URL from which the finished HTML is served. |
237 | | -#html_use_opensearch = '' |
| 247 | +# html_use_opensearch = '' |
238 | 248 |
|
239 | 249 | # This is the file name suffix for HTML files (e.g. ".xhtml"). |
240 | | -#html_file_suffix = None |
| 250 | +# html_file_suffix = None |
241 | 251 |
|
242 | 252 | # Output file base name for HTML help builder. |
243 | | -htmlhelp_basename = 'zeek-docs' |
| 253 | +htmlhelp_basename = "zeek-docs" |
244 | 254 |
|
245 | 255 | # -- Options for LaTeX output -------------------------------------------------- |
246 | 256 |
|
247 | 257 | # The paper size ('letter' or 'a4'). |
248 | | -#latex_paper_size = 'letter' |
| 258 | +# latex_paper_size = 'letter' |
249 | 259 |
|
250 | 260 | # The font size ('10pt', '11pt' or '12pt'). |
251 | | -#latex_font_size = '10pt' |
| 261 | +# latex_font_size = '10pt' |
252 | 262 |
|
253 | 263 | # Grouping the document tree into LaTeX files. List of tuples |
254 | 264 | # (source start file, target name, title, author, documentclass [howto/manual]). |
255 | 265 | latex_documents = [ |
256 | | - ('index', 'Zeek.tex', 'Zeek Documentation', |
257 | | - 'The Zeek Project', 'manual'), |
| 266 | + ("index", "Zeek.tex", "Zeek Documentation", "The Zeek Project", "manual"), |
258 | 267 | ] |
259 | 268 |
|
260 | 269 | # The name of an image file (relative to this directory) to place at the top of |
261 | 270 | # the title page. |
262 | | -#latex_logo = None |
| 271 | +# latex_logo = None |
263 | 272 |
|
264 | 273 | # For "manual" documents, if this is true, then toplevel headings are parts, |
265 | 274 | # not chapters. |
266 | | -#latex_use_parts = False |
| 275 | +# latex_use_parts = False |
267 | 276 |
|
268 | 277 | # If true, show page references after internal links. |
269 | | -#latex_show_pagerefs = False |
| 278 | +# latex_show_pagerefs = False |
270 | 279 |
|
271 | 280 | # If true, show URL addresses after external links. |
272 | | -#latex_show_urls = False |
| 281 | +# latex_show_urls = False |
273 | 282 |
|
274 | 283 | # Additional stuff for the LaTeX preamble. |
275 | | -#latex_preamble = '' |
| 284 | +# latex_preamble = '' |
276 | 285 |
|
277 | 286 | # Documents to append as an appendix to all manuals. |
278 | | -#latex_appendices = [] |
| 287 | +# latex_appendices = [] |
279 | 288 |
|
280 | 289 | # If false, no module index is generated. |
281 | | -#latex_domain_indices = True |
| 290 | +# latex_domain_indices = True |
282 | 291 |
|
283 | 292 | # -- Options for manual page output -------------------------------------------- |
284 | 293 |
|
285 | 294 | # One entry per manual page. List of tuples |
286 | 295 | # (source start file, name, description, authors, manual section). |
287 | | -man_pages = [ |
288 | | - ('index', 'zeek', 'Zeek Documentation', |
289 | | - ['The Zeek Project'], 1) |
290 | | -] |
| 296 | +man_pages = [("index", "zeek", "Zeek Documentation", ["The Zeek Project"], 1)] |
291 | 297 |
|
292 | 298 | # -- Options for todo plugin -------------------------------------------- |
293 | | -todo_include_todos=True |
| 299 | +todo_include_todos = True |
294 | 300 |
|
295 | 301 | extlinks = { |
296 | | - 'slacklink': ('https://zeek.org/slack%s', None), |
297 | | - 'discourselink': ('https://community.zeek.org/%s', None), |
298 | | - 'spicylink': ('https://docs.zeek.org/projects/spicy/en/latest/%s', None), |
| 302 | + "slacklink": ("https://zeek.org/slack%s", None), |
| 303 | + "discourselink": ("https://community.zeek.org/%s", None), |
| 304 | + "spicylink": ("https://docs.zeek.org/projects/spicy/en/latest/%s", None), |
299 | 305 | } |
300 | 306 | extlinks_detect_hardcoded_links = True |
0 commit comments