From f3223581812ebfe451696c0dc09765622eb5d870 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Fri, 15 Dec 2023 16:08:49 -0800 Subject: [PATCH] auto nav --- .github/workflows/_release.yml | 9 +-------- .readthedocs.yaml | 1 + docs/api_reference/conf.py | 10 +++++++--- docs/api_reference/requirements.txt | 1 - docs/api_reference/themes/scikit-learn-modern/nav.html | 10 ++++------ 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 0d9e381312908..e9b8be33c5856 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -11,15 +11,8 @@ on: inputs: working-directory: required: true - type: choice + type: string default: 'libs/langchain' - options: - - libs/langchain - - libs/core - - libs/experimental - - libs/community - - libs/partners/google-genai - - libs/partners/nvidia-aiplay env: PYTHON_VERSION: "3.10" diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 81cc6394785ce..f6399faa6d716 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: - python -m pip install --upgrade --no-cache-dir pip setuptools - python -m pip install --upgrade --no-cache-dir sphinx readthedocs-sphinx-ext - python -m pip install --exists-action=w --no-cache-dir -r docs/api_reference/requirements.txt + - python -m pip install ./libs/partners/* - python docs/api_reference/create_api_rst.py - cat docs/api_reference/conf.py - python -m sphinx -T -E -b html -d _build/doctrees -c docs/api_reference docs/api_reference $READTHEDOCS_OUTPUT/html -j auto diff --git a/docs/api_reference/conf.py b/docs/api_reference/conf.py index 58963e334629c..2a3defb19117b 100644 --- a/docs/api_reference/conf.py +++ b/docs/api_reference/conf.py @@ -141,6 +141,12 @@ def setup(app): for old_link in redirects: html_additional_pages[old_link] = "redirects.html" +partners_dir = Path(__file__).parent.parent.parent / "libs/partners" +partners = [ + (p.name, p.name.replace("-", "_") + "_api_reference") + for p in partners_dir.iterdir() +] + html_context = { "display_github": True, # Integrate GitHub "github_user": "langchain-ai", # Username @@ -148,9 +154,7 @@ def setup(app): "github_version": "master", # Version "conf_py_path": "/docs/api_reference", # Path in the checkout to the docs root "redirects": redirects, - "drop_down_navigation": [ - ("Google Generative AI", "https://python.langchain.com", "") - ], + "partners": partners, } # Add any paths that contain custom static files (such as style sheets) here, diff --git a/docs/api_reference/requirements.txt b/docs/api_reference/requirements.txt index 4ef83a5836a34..e5829ed5d9cdc 100644 --- a/docs/api_reference/requirements.txt +++ b/docs/api_reference/requirements.txt @@ -2,7 +2,6 @@ -e libs/langchain -e libs/core -e libs/community --e libs/partners/google-genai pydantic<2 autodoc_pydantic==1.8.0 myst_parser diff --git a/docs/api_reference/themes/scikit-learn-modern/nav.html b/docs/api_reference/themes/scikit-learn-modern/nav.html index dd14c4c106645..3a99820822591 100644 --- a/docs/api_reference/themes/scikit-learn-modern/nav.html +++ b/docs/api_reference/themes/scikit-learn-modern/nav.html @@ -6,8 +6,6 @@ {%- set top_container_cls = "sk-landing-container" %} {%- endif %} -{# title, link, link_attrs #} -