From c28c468cc2fc89612eb204a54359e71e9c9f02b8 Mon Sep 17 00:00:00 2001 From: nikki everett Date: Mon, 14 Oct 2024 14:44:22 -0500 Subject: [PATCH 1/3] first pass at pydata switcher Signed-off-by: nikki everett --- docs/_static/switcher.json | 31 +++++++++++++++++++++++++++++++ docs/conf.py | 6 +++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 docs/_static/switcher.json diff --git a/docs/_static/switcher.json b/docs/_static/switcher.json new file mode 100644 index 0000000000..17b9a8fba9 --- /dev/null +++ b/docs/_static/switcher.json @@ -0,0 +1,31 @@ +[ + { + "name": "latest", + "version": "latest", + "url": "https://docs.flyte.org/en/latest/" + }, + { + "version": "v1.13.1", + "url": "https://docs.flyte.org/en/v1.13.1" + }, + { + "version": "v1.13.0", + "url": "https://docs.flyte.org/en/v1.13.0" + }, + { + "version": "v1.12.0", + "url": "https://docs.flyte.org/en/v1.12.0" + }, + { + "version": "v1.11.0", + "url": "https://docs.flyte.org/en/v1.11.0" + }, + { + "version": "v1.10.7", + "url": "https://docs.flyte.org/en/v1.10.7" + }, + { + "version": "v1.10.6", + "url": "https://docs.flyte.org/en/v1.10.6" + } +] \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 316acc60be..8cf9499365 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -385,6 +385,9 @@ "doc_path": "docs", } +json_url = "_static/switcher.json" +version_match = "latest" + html_theme_options = { # custom flyteorg pydata theme options # "github_url": "https://github.com/flyteorg/flyte", @@ -415,8 +418,9 @@ } ], "use_edit_page_button": True, - "navbar_start": ["navbar-logo"], + "navbar_start": ["navbar-logo", "version-switcher"], "secondary_sidebar_items": ["page-toc", "edit-this-page"], + "switcher": {"json_url": json_url, "version_match": version_match} } # Add any paths that contain custom static files (such as style sheets) here, From 466b81a56931fbdd6002957a7479c238974cf1eb Mon Sep 17 00:00:00 2001 From: nikki everett Date: Mon, 14 Oct 2024 16:41:28 -0500 Subject: [PATCH 2/3] add dev option Signed-off-by: nikki everett --- docs/_static/switcher.json | 9 +++++++++ docs/conf.py | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/_static/switcher.json b/docs/_static/switcher.json index 17b9a8fba9..1024b9bafa 100644 --- a/docs/_static/switcher.json +++ b/docs/_static/switcher.json @@ -1,9 +1,18 @@ [ + { + "name": "dev", + "version": "dev", + "url": "https://docs.flyte.org/en/latest/" + }, { "name": "latest", "version": "latest", "url": "https://docs.flyte.org/en/latest/" }, + { + "version": "v1.13.2", + "url": "https://docs.flyte.org/en/v1.13.2" + }, { "version": "v1.13.1", "url": "https://docs.flyte.org/en/v1.13.1" diff --git a/docs/conf.py b/docs/conf.py index 8cf9499365..b2b03ed76b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -386,7 +386,10 @@ } json_url = "_static/switcher.json" -version_match = "latest" +version_match = os.environ.get("READTHEDOCS_VERSION") + +if not version_match: + version_match = "dev" html_theme_options = { # custom flyteorg pydata theme options From 8a1f9fe136f986fad200b5cf816befb5c32fe0aa Mon Sep 17 00:00:00 2001 From: nikki everett Date: Mon, 14 Oct 2024 17:16:17 -0500 Subject: [PATCH 3/3] test fully-resolved URL Signed-off-by: nikki everett --- docs/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index b2b03ed76b..8adc857eca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -385,10 +385,11 @@ "doc_path": "docs", } -json_url = "_static/switcher.json" +json_url = "https://flyte--5846.org.readthedocs.build/en/5846/_static/switcher.json" version_match = os.environ.get("READTHEDOCS_VERSION") if not version_match: + json_url = "_static/switcher.json" version_match = "dev" html_theme_options = {