|
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',
|
|
54 | 57 | except ImportError:
|
55 | 58 | _tkinter = None
|
56 | 59 | # Treat warnings as errors, done here to prevent warnings in Sphinx code from
|
57 |
| -# causing spurious test failures. |
| 60 | +# causing spurious CPython test failures. |
58 | 61 | import warnings
|
59 | 62 | warnings.simplefilter('error')
|
60 | 63 | del warnings
|
|
80 | 83 | .. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``
|
81 | 84 | """
|
82 | 85 |
|
83 |
| -# There are two options for replacing |today|: either, you set today to some |
84 |
| -# non-false value, then it is used: |
| 86 | +# There are two options for replacing |today|. Either, you set today to some |
| 87 | +# non-false value and use it. |
85 | 88 | today = ''
|
86 |
| -# Else, today_fmt is used as the format for a strftime call. |
| 89 | +# Or else, today_fmt is used as the format for a strftime call. |
87 | 90 | today_fmt = '%B %d, %Y'
|
88 | 91 |
|
89 | 92 | # By default, highlight as Python 3.
|
|
95 | 98 | # Create table of contents entries for domain objects (e.g. functions, classes,
|
96 | 99 | # attributes, etc.). Default is True.
|
97 | 100 | toc_object_entries = True
|
| 101 | +# Hide parents to tidy up long entries in sidebar |
98 | 102 | toc_object_entries_show_parents = 'hide'
|
99 | 103 |
|
100 | 104 | # Ignore any .rst files in the includes/ directory;
|
101 |
| -# they're embedded in pages but not rendered individually. |
| 105 | +# they're embedded in pages but not rendered as individual pages. |
102 | 106 | # Ignore any .rst files in the venv/ directory.
|
103 | 107 | exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst']
|
104 | 108 | venvdir = os.getenv('VENVDIR')
|
|
329 | 333 | # Options for HTML output
|
330 | 334 | # -----------------------
|
331 | 335 |
|
332 |
| -# Use our custom theme. |
| 336 | +# Use our custom theme: https://github.com/python/python-docs-theme |
333 | 337 | html_theme = 'python_docs_theme'
|
| 338 | +# Location of overrides for theme templates and static files |
334 | 339 | html_theme_path = ['tools']
|
335 | 340 | html_theme_options = {
|
336 | 341 | 'collapsiblesidebar': True,
|
|
376 | 381 | html_last_updated_fmt, time.gmtime(html_time)
|
377 | 382 | )
|
378 | 383 |
|
379 |
| -# Path to find HTML templates. |
| 384 | +# Path to find HTML templates to override theme |
380 | 385 | templates_path = ['tools/templates']
|
381 | 386 |
|
382 | 387 | # Custom sidebar templates, filenames relative to this file.
|
|
621 | 626 | "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
|
622 | 627 | }
|
623 | 628 |
|
624 |
| -# Options for c_annotations |
625 |
| -# ------------------------- |
| 629 | +# Options for c_annotations extension |
| 630 | +# ----------------------------------- |
626 | 631 |
|
627 | 632 | # Relative filename of the data files
|
628 | 633 | refcount_file = 'data/refcounts.dat'
|
|
0 commit comments