|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# For the full list of built-in configuration values, see the documentation: |
| 4 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 5 | + |
| 6 | +# -- Project information ----------------------------------------------------- |
| 7 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 8 | + |
| 9 | +import os |
| 10 | +import subprocess |
| 11 | + |
| 12 | + |
| 13 | +# Automatically retrieve the project version from Git |
| 14 | +def get_version(): |
| 15 | + try: |
| 16 | + return subprocess.check_output(["git", "describe", "--tags"], encoding="utf-8").strip() |
| 17 | + except Exception: |
| 18 | + return "0.0.0" |
| 19 | + |
| 20 | + |
| 21 | +project = "AgentLab" |
| 22 | +author = "ServiceNow" |
| 23 | +release = get_version() # Full version string including tags |
| 24 | +version = release # Short version (e.g., 1.0) |
| 25 | + |
| 26 | + |
| 27 | +# -- General configuration --------------------------------------------------- |
| 28 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 29 | +extensions = [ |
| 30 | + "sphinx.ext.duration", |
| 31 | + "sphinx.ext.doctest", |
| 32 | + "sphinx.ext.autodoc", |
| 33 | + "sphinx.ext.autosummary", |
| 34 | + "sphinx.ext.intersphinx", |
| 35 | + # "myst_parser", # Add this to enable Markdown parsing |
| 36 | + "sphinx.ext.napoleon", |
| 37 | +] |
| 38 | + |
| 39 | +intersphinx_mapping = { |
| 40 | + "rtd": ("https://docs.readthedocs.io/en/stable/", None), |
| 41 | + "python": ("https://docs.python.org/3/", None), |
| 42 | + "sphinx": ("https://www.sphinx-doc.org/en/master/", None), |
| 43 | +} |
| 44 | +intersphinx_disabled_domains = ["std"] |
| 45 | + |
| 46 | +autodoc_default_options = { |
| 47 | + "members": True, |
| 48 | + "undoc-members": True, |
| 49 | + "show-inheritance": True, |
| 50 | +} |
| 51 | + |
| 52 | +source_suffix = { |
| 53 | + ".rst": "restructuredtext", |
| 54 | +} |
| 55 | + |
| 56 | + |
| 57 | +templates_path = ["_templates"] |
| 58 | +exclude_patterns = [] |
| 59 | + |
| 60 | + |
| 61 | +# -- Options for HTML output ------------------------------------------------- |
| 62 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 63 | + |
| 64 | +html_theme = "sphinx_rtd_theme" |
| 65 | +html_theme_options = { |
| 66 | + "navigation_depth": -1, |
| 67 | + "collapse_navigation": False, |
| 68 | + "display_version": True, |
| 69 | + "version_selector": True, |
| 70 | +} |
| 71 | +html_static_path = ["_static"] |
| 72 | + |
| 73 | +import sys |
| 74 | + |
| 75 | +sys.path.insert(0, os.path.abspath("../../src")) |
0 commit comments