From 254cddc2c12c36e55d26d240fec2f7d6e154f1fe Mon Sep 17 00:00:00 2001 From: Giovanni Volpe Date: Sat, 21 Dec 2024 09:56:16 +0100 Subject: [PATCH] Conf.py (#3) --- conf.py | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/conf.py b/conf.py index 820d66e3..961c6d68 100644 --- a/conf.py +++ b/conf.py @@ -3,25 +3,51 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +from datetime import datetime +import os +import sys + +# get release from environment variable +version = os.environ.get("VERSION", "") +if not version: + print("Error: VERSION environment variable not set.") + sys.exit(1) + +sys.path.insert(0, "release-code") + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'DeepTrack2' -copyright = '2024, The DeepTrack2 Team' -author = 'The DeepTrack2 Team' +project = "DeepTrack2" +copyright = f"{datetime.now().year}, The DeepTrack2 Team" +author = "The DeepTrack2 Team" +release = version # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = [] - -templates_path = ['_templates'] -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - +extensions = [ + "sphinx_automodapi.automodapi", + "sphinx.ext.githubpages", +] +numpydoc_show_class_members = False +automodapi_inheritance_diagram = False +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'alabaster' -html_static_path = ['_static'] +html_theme = "pydata_sphinx_theme" +html_static_path = ["_static"] +html_theme_options = { + "switcher": { + "json_url": "https://ORGANIZATION.github.io/REPO/latest/_static/switcher.json", + "version_match": version, + }, + "navbar_end": [ + "version-switcher", + "navbar-icon-links", + ], +}