|
1 | 1 | # Configuration file for the Sphinx documentation builder. |
2 | | - |
| 2 | +from pathlib import Path |
3 | 3 | # -- Project information |
4 | 4 |
|
5 | 5 | project = 'ChipFlow' |
|
10 | 10 | version = '0.1.0' |
11 | 11 |
|
12 | 12 | # -- General configuration |
13 | | - |
| 13 | +top_dir = Path(__file__).parent / ".." / ".." |
14 | 14 | extensions = [ |
15 | 15 | 'sphinx.ext.duration', |
16 | 16 | 'sphinx.ext.doctest', |
17 | | - 'sphinx.ext.autodoc', |
18 | | - 'sphinx.ext.autosummary', |
19 | 17 | 'sphinx.ext.intersphinx', |
20 | | - 'myst_parser', |
| 18 | + 'sphinx.ext.autosummary', |
21 | 19 | 'sphinx_copybutton', |
| 20 | + 'myst_parser', |
| 21 | + 'sphinx.ext.todo', |
| 22 | + 'sphinx.ext.autodoc', |
| 23 | + 'sphinx.ext.napoleon', |
| 24 | + 'sphinx_rtd_theme', |
| 25 | + 'sphinxcontrib.platformpicker', |
| 26 | + 'sphinxcontrib.yowasp_wavedrom', |
| 27 | + 'sphinx.ext.autodoc', |
| 28 | + 'sphinxext.rediraffe', |
22 | 29 | ] |
| 30 | +""" |
| 31 | + "sphinx_design", |
| 32 | + "sphinx_design_elements", |
| 33 | +""" |
| 34 | + |
| 35 | +rst_prolog = """ |
| 36 | +.. role:: amaranth |
| 37 | +
|
| 38 | +.. role:: amaranth-soc |
| 39 | +
|
| 40 | +.. role:: chipflow-lib |
| 41 | +
|
| 42 | +.. role:: py(code) |
| 43 | + :language: python |
| 44 | +""" |
| 45 | + |
23 | 46 |
|
24 | 47 | intersphinx_mapping = { |
25 | 48 | 'python': ('https://docs.python.org/3/', None), |
26 | | - 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), |
27 | 49 | } |
28 | 50 | intersphinx_disabled_domains = ['std'] |
29 | 51 |
|
| 52 | +exclude_patterns = [ |
| 53 | + 'amaranth/index.rst', |
| 54 | + 'amaranth/cover.rst', |
| 55 | + 'amaranth-soc/index.rst', |
| 56 | + 'amaranth-soc/cover.rst', |
| 57 | + ] |
| 58 | + |
| 59 | +rediraffe_redirects = { |
| 60 | + "simulator.rst": "amaranth/simulator.rst", |
| 61 | +} |
| 62 | + |
30 | 63 | templates_path = ['_templates'] |
31 | 64 |
|
32 | 65 | # -- Options for HTML output |
|
36 | 69 | # Favicon is not from `_static`, it gets copied: |
37 | 70 | html_favicon = "favicon.png" |
38 | 71 |
|
39 | | -html_theme_options = { |
40 | | - "light_logo": "images/logo.png", |
41 | | - "dark_logo": "images/logo-dark-mode.png", |
42 | | - "analytics_anonymize_ip": True, |
43 | | - "light_css_variables": { |
44 | | - "font-stack": "Poppins, Verdana, sans-serif", |
45 | | - "color-brand-primary": "#7C4FA0", |
46 | | - "color-brand-content": "#7C4FA0", |
47 | | - }, |
48 | | - "sidebar_hide_name": True, |
49 | | -} |
50 | | - |
51 | 72 | # These folders are copied to the documentation's HTML output |
52 | 73 | html_static_path = ["_static"] |
53 | 74 |
|
54 | | -html_css_files = [ |
55 | | - 'css/custom.css', |
56 | | -] |
| 75 | +html_logo = "_static/logo.png" |
57 | 76 |
|
58 | 77 | # These paths are either relative to html_static_path |
59 | 78 | # or fully qualified paths (eg. https://...) |
|
63 | 82 |
|
64 | 83 | # -- Options for EPUB output |
65 | 84 | epub_show_urls = 'footnote' |
| 85 | + |
| 86 | +autodoc_member_order = "bysource" |
| 87 | +autodoc_default_options = { |
| 88 | + "members": True, |
| 89 | + 'ignore-module-all': True |
| 90 | +} |
| 91 | +autodoc_preserve_defaults = True |
| 92 | +autodoc_inherit_docstrings = False |
| 93 | + |
| 94 | +napoleon_google_docstring = False |
| 95 | +napoleon_numpy_docstring = True |
| 96 | +napoleon_use_ivar = True |
| 97 | +napoleon_include_init_with_doc = True |
| 98 | +napoleon_include_special_with_doc = True |
| 99 | +napoleon_custom_sections = [ |
| 100 | + ("Attributes", "params_style"), # by default displays as "Variables", which is confusing |
| 101 | + ("Members", "params_style"), # `lib.wiring` signature members |
| 102 | + "Platform overrides" |
| 103 | +] |
| 104 | + |
| 105 | + |
| 106 | +linkcheck_ignore = [ |
| 107 | + r"^http://127\.0\.0\.1:8000$", |
| 108 | + # Picked up automatically by ReST and doesn't have an index. |
| 109 | + r"^https://amaranth-lang\.org/schema/$", |
| 110 | +] |
| 111 | + |
| 112 | +linkcheck_anchors_ignore_for_url = [ |
| 113 | + r"^https://matrix\.to/", |
| 114 | + r"^https://web\.libera\.chat/", |
| 115 | + # React page with README content included as a JSON payload. |
| 116 | + r"^https://github\.com/[^/]+/[^/]+/$", |
| 117 | +] |
| 118 | + |
| 119 | + |
| 120 | +# Silence the warnings globally; otherwise they may fire on object destruction and crash completely |
| 121 | +# unrelated tests. |
| 122 | +import amaranth._unused |
| 123 | +amaranth._unused.MustUse._MustUse__silence = True |
0 commit comments