conf.py•3.16 kB
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "RMCP"
copyright = "2024, Gaurav Sood"
author = "Gaurav Sood"
# Get version from package
sys.path.insert(0, os.path.abspath(".."))
try:
from rmcp.version import get_version
version = get_version()
release = get_version()
except ImportError:
# Fallback if package not available
version = "0.7.0"
release = "0.7.0"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
"myst_parser",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# Source file parsers
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = f"RMCP {version} Documentation"
# Theme options
html_theme_options = {
"analytics_id": "",
"logo_only": False,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
}
# -- Extension configuration -------------------------------------------------
# autodoc
autodoc_default_options = {
"members": True,
"member-order": "bysource",
"special-members": "__init__",
"undoc-members": True,
"exclude-members": "__weakref__",
"show-inheritance": True,
}
autodoc_typehints = "both"
autodoc_typehints_description_target = "documented"
autodoc_preserve_defaults = True
# autosummary
autosummary_generate = True
autosummary_generate_overwrite = True
autosummary_imported_members = False
# napoleon - for Google/NumPy style docstrings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
# intersphinx
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"click": ("https://click.palletsprojects.com/en/8.1.x/", None),
}
# MyST parser configuration
myst_enable_extensions = [
"deflist",
"tasklist",
"colon_fence",
"attrs_inline",
"attrs_block",
]
# autosectionlabel
autosectionlabel_prefix_document = True
# Copy button configuration
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True