# 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 from pathlib import Path # Add the project root to the Python path project_root = Path(__file__).parent sys.path.insert(0, str(project_root)) sys.path.insert(0, str(project_root / "api")) sys.path.insert(0, str(project_root / "agents")) sys.path.insert(0, str(project_root / "kg_services")) # -- Project information ----------------------------------------------------- project = "KGraph-MCP" copyright = "2024, KGraph-MCP Development Team" author = "KGraph-MCP Development Team" release = "0.1.0" # -- General configuration --------------------------------------------------- extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.napoleon", "sphinx.ext.viewcode", "sphinx.ext.intersphinx", "sphinx.ext.todo", "sphinx.ext.coverage", "sphinx.ext.mathjax", "sphinx_autodoc_typehints", "myst_parser", ] templates_path = ["_templates"] exclude_patterns = [ "_build", "Thumbs.db", ".DS_Store", ".venv", "site", "node_modules", "htmlcov", "KGraph-MCP-Hackathon", "__pycache__", ".git", ".pytest_cache", ".mypy_cache", ".ruff_cache", ] # -- Options for HTML output ------------------------------------------------- html_theme = "sphinx_rtd_theme" html_static_path = ["_static"] # -- Extension configuration ------------------------------------------------- # Napoleon settings 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_admonition_for_examples = False napoleon_use_admonition_for_notes = False napoleon_use_admonition_for_references = False napoleon_use_ivar = False napoleon_use_param = True napoleon_use_rtype = True napoleon_preprocess_types = False 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__" } # AutoAPI settings autoapi_dirs = ["api", "agents", "kg_services"] autoapi_type = "python" autoapi_template_dir = "_templates/autoapi" autoapi_options = [ "members", "undoc-members", "show-inheritance", "show-module-summary", "special-members", ] autoapi_ignore = [ "*migrations*", "*tests*", "*test_*", "*conftest*", "*__pycache__*", ] autoapi_python_class_content = "both" autoapi_member_order = "groupwise" autoapi_root = "api" autoapi_keep_files = True autoapi_generate_api_docs = False # We generate manually # Intersphinx mapping intersphinx_mapping = { "python": ("https://docs.python.org/3", None), "fastapi": ("https://fastapi.tiangolo.com", None), "networkx": ("https://networkx.org/documentation/stable/", None), } # Type hints configuration typehints_fully_qualified = False always_document_param_types = True typehints_document_rtype = True typehints_use_rtype = True # TODO extension todo_include_todos = True # MyST configuration myst_enable_extensions = [ "amsmath", "colon_fence", "deflist", "dollarmath", "html_image", "html_admonition", "linkify", "replacements", "smartquotes", "substitution", "tasklist", ] # -- Custom configuration --------------------------------------------------- # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". if not os.path.exists("_static"): os.makedirs("_static") # HTML theme options html_theme_options = { "collapse_navigation": False, "sticky_navigation": True, "navigation_depth": 4, "includehidden": True, "titles_only": False, "logo_only": False, "display_version": True, "prev_next_buttons_location": "bottom", "style_external_links": False, "vcs_pageview_mode": "", "style_nav_header_background": "#2980B9", } html_context = { "display_github": True, "github_user": "BasalGanglia", "github_repo": "kgraph-mcp-hackathon", "github_version": "main", "conf_py_path": "/", } # Custom sidebar html_sidebars = { "**": [ "globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html", ] } # LaTeX output latex_elements = { "papersize": "letterpaper", "pointsize": "10pt", "preamble": "", "figure_align": "htbp", } # Grouping the document tree into LaTeX files latex_documents = [ ("index", "KGraph-MCP.tex", "KGraph-MCP Documentation", "KGraph-MCP Development Team", "manual"), ] # Man page output man_pages = [ ("index", "kgraph-mcp", "KGraph-MCP Documentation", [author], 1) ] # Texinfo output texinfo_documents = [ ("index", "KGraph-MCP", "KGraph-MCP Documentation", author, "KGraph-MCP", "The Self-Orchestrating Tool Network.", "Miscellaneous"), ] # -- Custom processing ------------------------------------------------------- def setup(app): """Custom Sphinx setup function.""" # Add custom CSS if os.path.exists("_static/custom.css"): app.add_css_file("custom.css")