"""
Configuration file for the Sphinx documentation builder.
This file only contains a selection of the most common options. For a full
list see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
import os
import sys
from datetime import datetime
# Add project root to Python path
sys.path.insert(0, os.path.abspath('../..'))
# Project information
project = 'Shannon MCP'
copyright = f'{datetime.now().year}, Shannon MCP Contributors'
author = 'Shannon MCP Contributors'
release = '0.1.0'
# General configuration
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.githubpages',
'sphinx_rtd_theme',
'sphinx_copybutton',
]
# Templates path
templates_path = ['_templates']
# Exclude patterns
exclude_patterns = []
# The theme to use for HTML and HTML Help pages
html_theme = 'sphinx_rtd_theme'
# Theme options
html_theme_options = {
'navigation_depth': 4,
'collapse_navigation': False,
'sticky_navigation': True,
'includehidden': True,
'titles_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': True,
}
# Add any paths that contain custom static files
html_static_path = ['_static']
# Custom sidebar templates
html_sidebars = {
'**': [
'localtoc.html',
'relations.html',
'searchbox.html',
]
}
# Napoleon settings for Google style docstrings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = True
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_references = True
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_type_aliases = None
napoleon_attr_annotations = True
# Autodoc settings
autodoc_default_options = {
'members': True,
'member-order': 'bysource',
'special-members': '__init__',
'undoc-members': True,
'exclude-members': '__weakref__',
'show-inheritance': True,
}
# Intersphinx mapping
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'aiofiles': ('https://aiofiles.readthedocs.io/en/latest/', None),
'asyncio': ('https://docs.python.org/3/library/asyncio.html', None),
}
# Todo extension settings
todo_include_todos = True
# Copy button settings
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True
# Add custom CSS
def setup(app):
app.add_css_file('custom.css')