Files
tzst/docs/conf.py
T
xixu-me 23dcdab305 Update documentation structure and configuration
Revised Sphinx directives in CLI and exceptions API docs to use ':no-index' instead of ':members', ':undoc-members', and ':show-inheritance'. Removed 'display_version' from Sphinx configuration. Added 'README' to the index page for better navigation.
2025-06-06 15:47:38 +08:00

90 lines
2.3 KiB
Python

# Configuration file for the Sphinx documentation builder.
import os
import sys
# Add the source directory to the Python path
sys.path.insert(0, os.path.abspath("../src"))
# Import version from the package
from tzst import __version__
# -- Project information -----------------------------------------------------
project = "tzst"
copyright = "2025, Xi Xu"
author = "Xi Xu"
release = __version__
version = __version__
# -- General configuration ---------------------------------------------------
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"myst_parser",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# -- Options for HTML output -------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = f"tzst {version} Documentation"
html_short_title = "tzst"
# Theme options
html_theme_options = {
"canonical_url": "https://xixu-me.github.io/tzst/",
"logo_only": False,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"style_nav_header_background": "#2980B9",
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
}
# -- Extension configuration -------------------------------------------------
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
"special-members": "__init__",
"exclude-members": "__weakref__",
}
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_param = True
napoleon_use_rtype = True
# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"zstandard": ("https://python-zstandard.readthedocs.io/en/latest/", None),
}
# Autosummary
autosummary_generate = True
myst_enable_extensions = [
"colon_fence",
"deflist",
"fieldlist",
"html_admonition",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]