|
| 1 | +import tomllib |
| 2 | +from pathlib import Path |
| 3 | +from datetime import datetime |
| 4 | + |
| 5 | + |
| 6 | +_ROOT = Path(__file__).resolve().parents[1] |
| 7 | +_pyproject = tomllib.loads((_ROOT / "pyproject.toml").read_text(encoding="utf-8")) |
| 8 | + |
| 9 | +project = _pyproject["project"]["name"] |
| 10 | +author = ", ".join(a["name"] for a in _pyproject["project"].get("authors", [])) or "Unknown" |
| 11 | +copyright = f"{datetime.now().year}, {author}" |
| 12 | + |
| 13 | +release = _pyproject["project"].get("version", "-dev") |
| 14 | + |
| 15 | + |
| 16 | +extensions = [ |
| 17 | + "sphinx.ext.autodoc", |
| 18 | + # "sphinx.ext.viewcode", |
| 19 | + "autoapi.extension", |
| 20 | + "sphinx_rtd_theme", |
| 21 | + "myst_parser", |
| 22 | +] |
| 23 | + |
| 24 | +source_suffix = ['.rst', '.md'] |
| 25 | + |
| 26 | +autoapi_type = 'python' |
| 27 | +autoapi_dirs = ['../src/rfc3987_syntax2'] |
| 28 | +# see https://sphinx-autoapi.readthedocs.io/en/latest/reference/config.html#confval-autoapi_options |
| 29 | +autoapi_options = [ |
| 30 | + 'show-module-summary', |
| 31 | + 'members', |
| 32 | + 'undoc-members', |
| 33 | + 'inherited-members', |
| 34 | + 'show-inheritance', |
| 35 | + 'imported-members' |
| 36 | +] |
| 37 | + |
| 38 | + |
| 39 | +# List of patterns, relative to source directory, that match files and |
| 40 | +# directories to ignore when looking for source files. |
| 41 | +# This pattern also affects html_static_path and html_extra_path. |
| 42 | +# see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-exclude_patterns |
| 43 | +exclude_patterns = [ |
| 44 | + '_dev', # internal docs |
| 45 | + '_build', # build target |
| 46 | + '.*', '**/.*', # dotfiles and folders |
| 47 | + 'Thumbs.db', '**/Thumbs.db', |
| 48 | +] |
| 49 | + |
| 50 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 51 | +# a list of builtin themes. |
| 52 | +# |
| 53 | +html_theme = 'sphinx_rtd_theme' |
| 54 | + |
0 commit comments