From 86599ecbeedd8b1ddd77e77ecfef3c75a3314f3a Mon Sep 17 00:00:00 2001 From: David Fluck Date: Fri, 20 Sep 2024 18:04:42 -0400 Subject: [PATCH] build: INFENG-883: remove unused docs version picker code (#9964) --- docs/insert-version-url.py | 41 ---------------------------- tools/scripts/insert-dropdown-url.sh | 13 --------- 2 files changed, 54 deletions(-) delete mode 100644 docs/insert-version-url.py delete mode 100755 tools/scripts/insert-dropdown-url.sh diff --git a/docs/insert-version-url.py b/docs/insert-version-url.py deleted file mode 100644 index 61d40a8084b3..000000000000 --- a/docs/insert-version-url.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 - -""" -Insert an entry into the version dropdown json file. - -Usage: insert-version-url.py your.version.here -""" - -import json -import os -import sys - - -def insert_entry(json_file, entry): - # The current dev version comes first and all released versions are in reverse chronological - # order, so the latest release always goes in index 1. - entry_position = 1 - with open(json_file, "rb") as f: - all_urls = json.load(f) - - all_urls.insert(entry_position, entry) - - with open(json_file, "w") as f: - json.dump(all_urls, f, indent=4 * " ") - f.write("\n") - - -def insert_version_url(json_file, version): - insert_entry(json_file, {"version": version, "url": f"https://docs.determined.ai/{version}/"}) - - print(f"Added dropdown link for version {version}") - - -if __name__ == "__main__": - if len(sys.argv) < 2: - print(__doc__, file=sys.stderr) - sys.exit(1) - - current_directory = os.path.dirname(__file__) - versions_json_path = os.path.join(current_directory, "_static/version-switcher/versions.json") - insert_version_url(versions_json_path, sys.argv[1]) diff --git a/tools/scripts/insert-dropdown-url.sh b/tools/scripts/insert-dropdown-url.sh deleted file mode 100755 index 0d133002cc16..000000000000 --- a/tools/scripts/insert-dropdown-url.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -ex - -# check for dirty changes -if [[ -n "$(git status --porcelain)" ]]; then - echo "untracked or dirty files are not allowed, cleanup before running insert-dropdown-url.sh" - exit 1 -fi - -# insert-version-url.py inserts a new entry into the versions.json--adding a dropdown link -python3 docs/insert-version-url.py "$(grep -oE '^[0-9.]*' VERSION)" - -git add --update -git commit -m "chore: add docs dropdown link for new version"