|
13 | 13 |
|
14 | 14 | import sphinx |
15 | 15 |
|
| 16 | +# Make our custom extensions available to Sphinx |
16 | 17 | sys.path.append(os.path.abspath('tools/extensions')) |
17 | 18 | sys.path.append(os.path.abspath('includes')) |
18 | 19 |
|
| 20 | +# Python specific content from Doc/Tools/extensions/pyspecific.py |
19 | 21 | from pyspecific import SOURCE_URI |
20 | 22 |
|
21 | 23 | # General configuration |
22 | 24 | # --------------------- |
23 | 25 |
|
| 26 | +# Our custom Sphinx extensions are found in Doc/Tools/extensions/ |
24 | 27 | extensions = [ |
25 | 28 | 'audit_events', |
26 | 29 | 'availability', |
|
48 | 51 | except ImportError: |
49 | 52 | _tkinter = None |
50 | 53 | # Treat warnings as errors, done here to prevent warnings in Sphinx code from |
51 | | -# causing spurious test failures. |
| 54 | +# causing spurious CPython test failures. |
52 | 55 | import warnings |
53 | 56 | warnings.simplefilter('error') |
54 | 57 | del warnings |
|
72 | 75 | .. |python_version_literal| replace:: ``Python {version}`` |
73 | 76 | """ |
74 | 77 |
|
75 | | -# There are two options for replacing |today|: either, you set today to some |
76 | | -# non-false value, then it is used: |
| 78 | +# There are two options for replacing |today|. Either, you set today to some |
| 79 | +# non-false value and use it. |
77 | 80 | today = '' |
78 | | -# Else, today_fmt is used as the format for a strftime call. |
| 81 | +# Or else, today_fmt is used as the format for a strftime call. |
79 | 82 | today_fmt = '%B %d, %Y' |
80 | 83 |
|
81 | 84 | # By default, highlight as Python 3. |
|
87 | 90 | # Create table of contents entries for domain objects (e.g. functions, classes, |
88 | 91 | # attributes, etc.). Default is True. |
89 | 92 | toc_object_entries = True |
| 93 | +# Hide parents to tidy up long entries in sidebar |
90 | 94 | toc_object_entries_show_parents = 'hide' |
91 | 95 |
|
92 | 96 | # Ignore any .rst files in the includes/ directory; |
93 | | -# they're embedded in pages but not rendered individually. |
| 97 | +# they're embedded in pages but not rendered as individual pages. |
94 | 98 | # Ignore any .rst files in the venv/ directory. |
95 | 99 | exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst'] |
96 | 100 | venvdir = os.getenv('VENVDIR') |
|
307 | 311 | # Options for HTML output |
308 | 312 | # ----------------------- |
309 | 313 |
|
310 | | -# Use our custom theme. |
| 314 | +# Use our custom theme: https://github.com/python/python-docs-theme |
311 | 315 | html_theme = 'python_docs_theme' |
| 316 | +# Location of overrides for theme templates and static files |
312 | 317 | html_theme_path = ['tools'] |
313 | 318 | html_theme_options = { |
314 | 319 | 'collapsiblesidebar': True, |
|
354 | 359 | html_last_updated_fmt, time.gmtime(html_time) |
355 | 360 | ) |
356 | 361 |
|
357 | | -# Path to find HTML templates. |
| 362 | +# Path to find HTML templates to override theme |
358 | 363 | templates_path = ['tools/templates'] |
359 | 364 |
|
360 | 365 | # Custom sidebar templates, filenames relative to this file. |
|
600 | 605 | "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"), |
601 | 606 | } |
602 | 607 |
|
603 | | -# Options for c_annotations |
604 | | -# ------------------------- |
| 608 | +# Options for c_annotations extension |
| 609 | +# ----------------------------------- |
605 | 610 |
|
606 | 611 | # Relative filename of the data files |
607 | 612 | refcount_file = 'data/refcounts.dat' |
|
0 commit comments