"""Sphinx configuration file."""
import os
import sys
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent.parent
sys.path.insert(0, str(project_root))
import comfy_mcp
# Project information
project = "ComfyUI MCP Server"
copyright = "2024, Christian Byrne"
author = "Christian Byrne"
version = comfy_mcp.__version__
release = comfy_mcp.__version__
# Extensions
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
"myst_parser",
]
# Extension settings
autodoc_default_options = {
"members": True,
"member-order": "bysource",
"special-members": "__init__",
"undoc-members": True,
"exclude-members": "__weakref__",
}
autosummary_generate = True
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pydantic": ("https://docs.pydantic.dev/latest/", None),
}
# MyST settings
myst_enable_extensions = [
"colon_fence",
"deflist",
"dollarmath",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"substitution",
"tasklist",
]
# Templates and static files
templates_path = ["_templates"]
html_static_path = ["_static"]
# HTML theme
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"canonical_url": "",
"analytics_id": "",
"logo_only": False,
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"vcs_pageview_mode": "",
"style_nav_header_background": "#2980B9",
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
}
# Files to exclude
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# Source file suffixes
source_suffix = {
".rst": None,
".md": "myst_parser",
}
# Master document
master_doc = "index"
# Language
language = "en"
# HTML options
html_title = f"{project} v{version}"
html_short_title = project
html_show_sphinx = False
html_show_copyright = True
html_show_sourcelink = True
# LaTeX options
latex_elements = {
"papersize": "letterpaper",
"pointsize": "10pt",
"preamble": "",
"fncychap": "",
"maketitle": "",
"printindex": "",
}
latex_documents = [
(master_doc, f"{project.lower().replace(' ', '_')}.tex", html_title, author, "manual"),
]