Files
tzst/docs/conf.py
T
google-labs-jules[bot] 1f4b77ffc7 Update copyright year to be dynamic and sync docs with README
- Update `docs/conf.py` to use `datetime` for dynamic copyright year.
- Update `docs/quickstart.md` to match installation instructions from `README.md`.
- Remove redundant installation details from `docs/index.md` and link to `quickstart`.
2025-12-31 17:05:26 +00:00

152 lines
4.6 KiB
Python

# Configuration file for the Sphinx documentation builder.
import os
import sys
from datetime import datetime
# 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 = f"{datetime.now().year}, 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",
"sphinx.ext.coverage",
"myst_parser",
"sphinx_sitemap",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# Base URL for sitemap generation
html_baseurl = "https://tzst.xi-xu.me/"
# Sitemap configuration
sitemap_url_scheme = "{link}"
sitemap_filename = "sitemap.xml"
# -- Options for HTML output -------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = f"tzst {version} Documentation"
html_short_title = "tzst"
# HTML meta tags
html_meta = {
"description": "tzst - A Python library for creating and extracting tar.zst archives with high performance and comprehensive features",
"keywords": "tzst, tar, zstandard, compression, archive, python, extraction, backup",
"author": "Xi Xu",
"robots": "index, follow",
"language": "en",
"viewport": "width=device-width, initial-scale=1.0",
"theme-color": "#2980B9",
"msapplication-TileColor": "#2980B9",
"og:title": "tzst Documentation",
"og:description": "tzst - A Python library for creating and extracting tar.zst archives with high performance and comprehensive features",
"og:type": "website",
"og:url": "https://tzst.xi-xu.me/",
"og:image": "https://tzst.xi-xu.me/_static/tzst-logo.png",
"og:site_name": "tzst Documentation",
"og:locale": "en_US",
"twitter:card": "summary_large_image",
"twitter:title": "tzst Documentation",
"twitter:description": "tzst - A Python library for creating and extracting tar.zst archives with high performance and comprehensive features",
"twitter:image": "https://tzst.xi-xu.me/_static/tzst-logo.png",
"twitter:site": "@xixu_me",
"twitter:creator": "@xixu_me",
"article:author": "Xi Xu",
"article:publisher": "https://xi-xu.me",
}
# Theme options
html_theme_options = {
"canonical_url": "https://tzst.xi-xu.me/",
"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": False,
"titles_only": False,
}
# Additional HTML options
html_favicon = "_static/favicon.ico" # Will show warning until favicon is created
html_logo = "_static/tzst-logo.png" # Will show warning until logo is created
html_use_opensearch = "https://tzst.xi-xu.me/"
# HTML context for custom template variables
html_context = {
"display_github": True,
"github_user": "xixu-me",
"github_repo": "tzst",
"github_version": "main",
"conf_py_path": "/docs/",
}
# -- 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",
]
# SEO optimization settings
html_copy_source = False # Don't copy source files to _sources (reduces crawl)
html_show_sourcelink = False # Hide "View page source" links
html_show_sphinx = False # Don't show "Created using Sphinx" in footer
# Additional HTML files to include (robots.txt will be copied from _static)
html_extra_path = []
# Language for content autogenerated by Sphinx
language = "en"