2020-04-27 01:21:31 -06:00
|
|
|
import os, sys
|
|
|
|
sys.path.insert(0, os.path.abspath("."))
|
|
|
|
|
2024-01-17 10:49:50 -07:00
|
|
|
import time
|
2023-12-01 09:00:48 -07:00
|
|
|
from importlib.metadata import version as package_version
|
|
|
|
|
2020-04-27 01:21:31 -06:00
|
|
|
|
2024-01-17 10:49:50 -07:00
|
|
|
project = "Amaranth language & toolchain"
|
2023-12-01 09:00:48 -07:00
|
|
|
version = package_version('amaranth').replace(".editable", "")
|
2020-04-27 01:21:31 -06:00
|
|
|
release = version.split("+")[0]
|
2024-01-17 10:49:50 -07:00
|
|
|
copyright = time.strftime("2020—%Y, Amaranth project contributors")
|
2020-04-27 01:21:31 -06:00
|
|
|
|
|
|
|
extensions = [
|
|
|
|
"sphinx.ext.intersphinx",
|
|
|
|
"sphinx.ext.doctest",
|
|
|
|
"sphinx.ext.todo",
|
2021-12-12 22:48:31 -07:00
|
|
|
"sphinx.ext.autodoc",
|
|
|
|
"sphinx.ext.napoleon",
|
2020-04-27 01:21:31 -06:00
|
|
|
"sphinx_rtd_theme",
|
2020-07-05 17:39:47 -06:00
|
|
|
"sphinxcontrib.platformpicker",
|
2024-04-07 01:56:28 -06:00
|
|
|
"sphinxcontrib.yowasp_wavedrom",
|
2020-04-27 01:21:31 -06:00
|
|
|
]
|
|
|
|
|
|
|
|
with open(".gitignore") as f:
|
|
|
|
exclude_patterns = [line.strip() for line in f.readlines()]
|
|
|
|
|
2021-12-10 23:32:32 -07:00
|
|
|
root_doc = "cover"
|
2020-07-01 02:03:57 -06:00
|
|
|
|
2023-12-01 09:00:48 -07:00
|
|
|
intersphinx_mapping = {
|
|
|
|
"python": ("https://docs.python.org/3", None),
|
|
|
|
}
|
2020-04-27 01:21:31 -06:00
|
|
|
|
|
|
|
todo_include_todos = True
|
|
|
|
|
2023-02-20 15:58:38 -07:00
|
|
|
autodoc_member_order = "bysource"
|
|
|
|
autodoc_default_options = {
|
|
|
|
"members": True
|
|
|
|
}
|
|
|
|
autodoc_preserve_defaults = True
|
2024-04-10 15:41:06 -06:00
|
|
|
autodoc_inherit_docstrings = False
|
2023-02-20 15:58:38 -07:00
|
|
|
|
2021-12-12 22:48:31 -07:00
|
|
|
napoleon_google_docstring = False
|
|
|
|
napoleon_numpy_docstring = True
|
|
|
|
napoleon_use_ivar = True
|
2023-02-20 15:58:38 -07:00
|
|
|
napoleon_include_init_with_doc = True
|
|
|
|
napoleon_include_special_with_doc = True
|
2024-03-22 01:24:10 -06:00
|
|
|
napoleon_custom_sections = [
|
|
|
|
("Attributes", "params_style"), # by default displays as "Variables", which is confusing
|
|
|
|
("Members", "params_style"), # `lib.wiring` signature members
|
|
|
|
"Platform overrides"
|
|
|
|
]
|
2021-12-12 22:48:31 -07:00
|
|
|
|
2020-04-27 01:21:31 -06:00
|
|
|
html_theme = "sphinx_rtd_theme"
|
|
|
|
html_static_path = ["_static"]
|
|
|
|
html_css_files = ["custom.css"]
|
2024-01-04 04:28:04 -07:00
|
|
|
html_logo = "_static/logo.png"
|
2023-08-17 18:12:18 -06:00
|
|
|
|
|
|
|
rst_prolog = """
|
2024-02-13 03:31:44 -07:00
|
|
|
.. role:: py(code)
|
2023-08-17 18:12:18 -06:00
|
|
|
:language: python
|
|
|
|
"""
|
2024-02-15 12:35:21 -07:00
|
|
|
|
|
|
|
linkcheck_ignore = [
|
2024-05-11 02:50:04 -06:00
|
|
|
r"^http://127\.0\.0\.1:8000$",
|
|
|
|
# Picked up automatically by ReST and doesn't have an index.
|
|
|
|
r"^https://amaranth-lang\.org/schema/$",
|
2024-02-15 12:35:21 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
linkcheck_anchors_ignore_for_url = [
|
|
|
|
r"^https://matrix\.to/",
|
|
|
|
r"^https://web\.libera\.chat/",
|
|
|
|
# React page with README content included as a JSON payload.
|
|
|
|
r"^https://github\.com/[^/]+/[^/]+/$",
|
|
|
|
]
|
2024-04-10 15:41:06 -06:00
|
|
|
|
|
|
|
|
|
|
|
# Silence the warnings globally; otherwise they may fire on object destruction and crash completely
|
|
|
|
# unrelated tests.
|
|
|
|
import amaranth._unused
|
|
|
|
amaranth._unused.MustUse._MustUse__silence = True
|