diff --git a/.gitignore b/.gitignore
index 78fe7f4ed..57d42ef3b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,8 +12,3 @@ static/data.json
static/hub-index-data.json
# The build version of spin up hub
spin-up-hub/dist/
-# The documentation migration backup files
-migration_scripts/content_backup/
-# The python compiled files
-migration_scripts/__pycache__
-migration_scripts/*.py[cod]
diff --git a/migration_scripts/README.md b/migration_scripts/README.md
deleted file mode 100644
index ef103d1d8..000000000
--- a/migration_scripts/README.md
+++ /dev/null
@@ -1,146 +0,0 @@
-- [Prerequisites](#prerequisites)
-- [Migration Scripts](#migration-scripts)
-- [Backup Content and Config](#backup-content-and-config)
-- [Create Mappings](#create-mappings)
-- [Move files](#move-files)
-- [Create redirects](#create-redirects)
-- [Sidebar Unification](#sidebar-unification)
-- [Check That All Pages Are Linked to in the Sidebar](#check-that-all-pages-are-linked-to-in-the-sidebar)
-- [Position Files and Folders - Ready For Testing](#position-files-and-folders---ready-for-testing)
-- [Testing Changes Locally](#testing-changes-locally)
-- [Push Changes](#push-changes)
-- [Clean Up](#clean-up)
-
-# Prerequisites
-
-```bash
-pip3 install openpyxl
-pip3 install requests
-```
-
-# Migration Scripts
-
-Fork the developer repository, clone your fork, create a new branch, set the remote:
-
-```bash
-cd ~
-git clone git@github.com:yourusername/developer.git
-cd developer
-git checkout -b my_new_branch
-git remote add upstream https://github.com/fermyon/developer
-```
-
-Change into the migration_scripts directory and then run the following scripts:
-
-```bash
-cd migration_scripts
-```
-
-# Backup Content and Config
-
-Run the following shell script to make it easy to reset (iterate while making decisions about the migration)
-
-```bash
-./backup_content.sh
-```
-
-# Create Mappings
-
-Run the create_url_vs_markdown_file_vs_toc_label_mapping.py script. It will generate a spreadsheet called mapping_information.xlsx which will contain all of the current url paths from the existing spin v2 sidebar template and the cloud sidebar template:
-
-```bash
-python3 create_url_vs_markdown_file_vs_toc_label_mapping.py
-```
-
-Open the mapping_information.xlsx spreadsheet and fill in the:
-- unified_url_path (the new url where the resource will be found online i.e. `/spin/v2/quickstart` vs `/docs/quickstart` etc.)
-- unified_file_path (the new file path where the markdown file will live i.e. `/spin/v2/quickstart` vs `/docs/quickstart` etc.)
-- unified_toc_label (the label that will appear in the ToC for that given markdown file)
-
-> **Please note** - the new labels have already been decided. See the `sidebar_structure.py` file for label strings to use in the spreadsheet (you are essentially mapping ToC labels to existing markdown files recorded in the spreadsheet). **A label that you add to the spreadsheet's `unified_toc_label` has to exactly match one of the text entries in the `sidebar_structure.py` file. Change one or the other until you have a match to ensure that the generation of the `unified_sidebar.hbs` will succeed.**
-
-Save the Excel spreadsheet file back to the same location before proceeding with any of the following scripts.
-
-# Move files
-
-Run the following scripts to move files to their new location on disk:
-
-```bash
-python3 move_markdown_files_to_unified_location.py
-```
-
-> If you are not satisfied with the outcome of this script, please run `./reset_content.sh` and try again.
-
-
-Check that no files are left over in either `/spin/v2` or `/cloud` directories (except for cloud changelog which should stay where it is).
-
-# Create redirects
-
-Run the following scripts to generate the redirect code for the spin.toml file:
-
-```bash
-python3 create_redirect_syntax_for_manifest.py
-```
-
-The script above will generate a new `updated_spin.toml` file.
-
-> If you are not satisfied with the outcome of this script, please re-run it. The `updated_spin.toml` file will be overwritten automatically.
-
-Go ahead and copy the `spin.toml` file from the migration_scripts directory, over to the application's root:
-
-```bash
-mv updated_spin.toml ../spin.toml
-```
-
-# Sidebar Unification
-
-The following script reads the mappings from above and generates a new sidebar `.hbs` file (that will be the replacement sidebar for the original cloud and spin sidebars):
-
-```bash
-python3 create_unified_sidebar.py
-```
-
-> If you are not satisfied with the outcome of this script, just re-run it. It will override the `docs_sidebar.hbs` file automatically.
-
-# Check That All Pages Are Linked to in the Sidebar
-
-Run the following script to make sure that all pages on the website are listed in the sidebar, where a user can click and open the page:
-
-```bash
-python3 check_that_all_pages_are_linked_to_in_sidebar.py
-```
-
-The above script will list all pages with either a cross ❌ or a check mark ✔ next to the file's name (we want all ✔ before we proceed).
-
-# Position Files and Folders - Ready For Testing
-
-```bash
-# Put the freshly generated sidebar file into place
-mv docs_sidebar.hbs ../templates/docs_sidebar.hbs
-```
-
-# Testing Changes Locally
-
-Perform the following to test changes locally:
-
-```bash
-cd ../../developer
-npm ci
-cd spin-up-hub
-npm ci
-cd ../../developer
-spin build
-spin up -e PREVIEW_MODE=1
-```
-
-# Push Changes
-
-```bash
-git add .
-git commit -S --signoff -m "Adding new unification structure"
-git push origin unification
-```
-
-# Clean Up
-
-Please run the `./clean_up_after_migration.sh` once the changes are approved and merged.
\ No newline at end of file
diff --git a/migration_scripts/backup_content.sh b/migration_scripts/backup_content.sh
deleted file mode 100755
index 78cfe9906..000000000
--- a/migration_scripts/backup_content.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-cp -rp ../content ./content_backup
-
diff --git a/migration_scripts/check_that_all_pages_are_linked_to_in_sidebar.py b/migration_scripts/check_that_all_pages_are_linked_to_in_sidebar.py
deleted file mode 100644
index db113c55d..000000000
--- a/migration_scripts/check_that_all_pages_are_linked_to_in_sidebar.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import os
-from pathlib import Path
-
-def construct_paths(base_dir, *sub_dirs):
- return [os.path.join(base_dir, *sub_dir) for sub_dir in sub_dirs]
-
-base_directory = os.path.dirname(__file__)
-
-markdown_file_subdirectories = [
- ["..", "content", "spin", "v2"],
- ["..", "content", "cloud"]
-]
-
-handlebars_template_subdirectories = [
- ["latest_sidebar.hbs"]
-]
-
-directories = construct_paths(base_directory, *markdown_file_subdirectories)
-try:
- menu = construct_paths(base_directory, *handlebars_template_subdirectories)[0]
- if not os.path.exists(menu):
- raise FileNotFoundError(f"The file {menu} does not exist. \nPlease run the create_unified_sidebar.py script and try again.")
- with open(menu, 'r') as file:
- content = file.read()
- for directory in directories:
- print(f"Checking {directory}...")
- for filename in os.listdir(directory):
- f = os.path.join(directory, filename)
- if os.path.isfile(f):
- docFileName = Path(f).stem
- if docFileName in content:
- print(docFileName + "\U00002714")
- else:
- print(docFileName + "\U0000274C")
-except FileNotFoundError as e:
- print(e)
diff --git a/migration_scripts/clean_up_after_migration.sh b/migration_scripts/clean_up_after_migration.sh
deleted file mode 100755
index 09d46bca4..000000000
--- a/migration_scripts/clean_up_after_migration.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-rm -rf ./content_backup
-rm -rf ./templates_backup
-rm -rf ./spin_toml_backup.toml
-rm -rf mapping_information.xlsx
-rm -rf latest_sidebar.hbs
-
-
diff --git a/migration_scripts/create_redirect_syntax_for_manifest.py b/migration_scripts/create_redirect_syntax_for_manifest.py
deleted file mode 100644
index 9fb91a48d..000000000
--- a/migration_scripts/create_redirect_syntax_for_manifest.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import re
-from urllib.parse import urljoin
-import requests
-import openpyxl
-
-def read_excel_to_dict(file_path):
- wb = openpyxl.load_workbook(file_path)
- ws = wb.active
- data = []
-
- # Skip the header row
- for row in ws.iter_rows(min_row=2, values_only=True):
- original_url_path, unified_url_path, original_file_path, unified_file_path, original_toc_label, unified_toc_label = row
- data.append({
- "original_url_path": original_url_path,
- "unified_url_path": unified_url_path,
- "original_file_path": original_file_path,
- "unified_file_path": unified_file_path,
- "original_toc_label": original_toc_label,
- "unified_toc_label": unified_toc_label
- })
- return data
-
-file_path = "mapping_information.xlsx"
-mapping_information = read_excel_to_dict(file_path)
-
-# Step 1: Download the raw version of the spin.toml file
-url = "https://raw.githubusercontent.com/fermyon/developer/main/spin.toml"
-response = requests.get(url)
-spin_toml_content = response.text
-
-last_redirect_index = spin_toml_content.rfind("[component.redirect")
-
-new_config_blocks = ""
-for entry in mapping_information:
- new_config_block = f"""
-# Redirect {entry['original_url_path']} to {entry['unified_url_path']}
-[component.redirect-{entry['unified_url_path'].strip('/').replace('/', '-')}]
-source = "modules/redirect.wasm"
-environment = {{ DESTINATION = "urljoin('https://developer.fermyon.com', {entry['unified_url_path']})" }}
-
-[[trigger.http]]
-id = "trigger-{entry['unified_url_path'].strip('/').replace('/', '-')}"
-component = "redirect-{entry['unified_url_path'].strip('/').replace('/', '-')}"
-route = "{entry['original_url_path']}"
-"""
- new_config_blocks += new_config_block
-
-updated_spin_toml_content = (
- spin_toml_content[:last_redirect_index]
- + spin_toml_content[last_redirect_index:]
- + new_config_blocks
-)
-
-with open("updated_spin.toml", "w") as file:
- file.write(updated_spin_toml_content)
-
-print("Updated spin.toml file has been written as 'updated_spin.toml'.")
\ No newline at end of file
diff --git a/migration_scripts/create_unified_sidebar.py b/migration_scripts/create_unified_sidebar.py
deleted file mode 100644
index 09e91e209..000000000
--- a/migration_scripts/create_unified_sidebar.py
+++ /dev/null
@@ -1,87 +0,0 @@
-import re
-import requests
-import openpyxl
-from sidebar_structure import sidebar_structure
-
-def read_excel_to_dict(file_path):
- wb = openpyxl.load_workbook(file_path)
- ws = wb.active
- data = []
-
- # Skip the header row
- for row in ws.iter_rows(min_row=2, values_only=True):
- original_url_path, unified_url_path, original_file_path, unified_file_path, original_toc_label, unified_toc_label = row
- data.append({
- "original_url_path": original_url_path,
- "unified_url_path": unified_url_path,
- "original_file_path": original_file_path,
- "unified_file_path": unified_file_path,
- "original_toc_label": original_toc_label,
- "unified_toc_label": unified_toc_label
- })
- return data
-
-def generate_handlebars(sidebar, mapping_information):
- handlebars_content = '
\n'
- counter = 0
-
- def recurse(items, parent_id=''):
- nonlocal counter
- local_handlebars = ''
- if isinstance(items, list):
- local_handlebars += f' \n'
- return local_handlebars
-
- for main_item in sidebar['toc']:
- handlebars_content += recurse(main_item)
-
- handlebars_content += '
\n'
- return handlebars_content
-
-def save_handlebars_file(content, filename='docs_sidebar.hbs'):
- with open(filename, 'w') as file:
- file.write(content)
-
-file_path = "mapping_information.xlsx"
-mapping_information = read_excel_to_dict(file_path)
-#print(mapping_information)
-
-# Generate Handlebars content from the sidebar structure
-handlebars_output = generate_handlebars(sidebar_structure, mapping_information)
-
-# Save the generated Handlebars to a file
-save_handlebars_file(handlebars_output)
-
-print("Handlebars file generated successfully!")
\ No newline at end of file
diff --git a/migration_scripts/create_url_vs_markdown_file_vs_toc_label_mapping.py b/migration_scripts/create_url_vs_markdown_file_vs_toc_label_mapping.py
deleted file mode 100644
index a53319817..000000000
--- a/migration_scripts/create_url_vs_markdown_file_vs_toc_label_mapping.py
+++ /dev/null
@@ -1,61 +0,0 @@
-import re
-import openpyxl
-from openpyxl import Workbook
-import requests
-
-# Remove formatting from the Handlebars template
-def remove_formatting(text):
- text = re.sub(r'\s+', ' ', text)
- text = re.sub(r'\t+', '', text)
- text = re.sub(r'\n+', '', text)
- return text
-
-# Function to fetch the content of a file from a GitHub repository
-def fetch_file_from_github(repo, filepath):
- url = f"https://raw.githubusercontent.com/{repo}/main/{filepath}"
- response = requests.get(url)
- if response.status_code == 200:
- return response.text
- else:
- raise Exception(f"Failed to fetch {filepath} from {repo}")
-
-repo = "fermyon/developer"
-original_spin_sidebar_v2 = fetch_file_from_github(repo, "templates/spin_sidebar_v2.hbs")
-spin_sidebar_v2 = remove_formatting(original_spin_sidebar_v2)
-original_cloud_sidebar = fetch_file_from_github(repo, "templates/cloud_sidebar.hbs")
-cloud_sidebar = remove_formatting(original_cloud_sidebar)
-
-#print(f"Cleaned Spin Sidebar Content\n{spin_sidebar_v2}")
-#print(f"Cleaned Cloud Sidebar Content\n{cloud_sidebar}")
-
-# Parsing the original Handlebars templates to extract links
-def extract_links(handlebars_template):
- pattern = r'"{{site\.info\.base_url}}(/(?:spin/v2|cloud|wasm-languages|static/image)/[\.a-zA-Z0-9/-]*)">([^<]+)'
- matches = re.findall(pattern, handlebars_template)
- print(f"Found {matches} links in the sidebar.")
- return [match for match in matches]
-
-spin_links = extract_links(spin_sidebar_v2)
-print(f"Extracted {len(spin_links)} links from the Spin sidebar.")
-cloud_links = extract_links(cloud_sidebar)
-print(f"Extracted {len(cloud_links)} links from the Cloud sidebar.")
-
-# Combine the links from both templates
-all_links = spin_links + cloud_links
-
-# Create a new Excel workbook and select the active worksheet
-wb = Workbook()
-ws = wb.active
-ws.title = "Links"
-
-# Write the headers
-ws.append(["original_url_path", "unified_url_path", "original_file_path", "unified_file_path", "original_toc_label", "unified_toc_label"])
-
-# Write the links to column A and leave columns B and C blank
-for link in all_links:
- ws.append([link[0], "/docs/",link[0], "/docs/", link[1], ""])
-
-# Save the workbook to a file
-wb.save("mapping_information.xlsx")
-
-print("Links have been written to mapping_information.xlsx")
\ No newline at end of file
diff --git a/migration_scripts/docs_sidebar.hbs b/migration_scripts/docs_sidebar.hbs
deleted file mode 100644
index 9757da5db..000000000
--- a/migration_scripts/docs_sidebar.hbs
+++ /dev/null
@@ -1,292 +0,0 @@
-
-
-
diff --git a/migration_scripts/mapping_information.xlsx b/migration_scripts/mapping_information.xlsx
deleted file mode 100644
index e4ad639ed..000000000
Binary files a/migration_scripts/mapping_information.xlsx and /dev/null differ
diff --git a/migration_scripts/move_markdown_files_to_unified_location.py b/migration_scripts/move_markdown_files_to_unified_location.py
deleted file mode 100644
index a0a61ca93..000000000
--- a/migration_scripts/move_markdown_files_to_unified_location.py
+++ /dev/null
@@ -1,72 +0,0 @@
-import re
-import os
-import shutil
-import requests
-import openpyxl
-from openpyxl import Workbook
-from pathlib import Path
-from urllib.parse import urljoin
-
-def construct_paths(base_dir, *sub_dirs):
- return [os.path.join(base_dir, *sub_dir) for sub_dir in sub_dirs]
-
-base_directory = os.path.dirname(__file__)
-
-markdown_file_subdirectories = [
- ["..", "content"]
-]
-
-def read_excel_to_dict(file_path):
- wb = openpyxl.load_workbook(file_path)
- ws = wb.active
- data = []
-
- # Skip the header row
- for row in ws.iter_rows(min_row=2, values_only=True):
- original_url_path, unified_url_path, original_file_path, unified_file_path, original_toc_label, unified_toc_label = row
- data.append({
- "original_url_path": original_url_path,
- "unified_url_path": unified_url_path,
- "original_file_path": original_file_path,
- "unified_file_path": unified_file_path,
- "original_toc_label": original_toc_label,
- "unified_toc_label": unified_toc_label
- })
- return data
-
-def update_url_in_markdown(file_path, old_url_path, new_url_path):
- # Read the file content
- with open(file_path, 'r', encoding='utf-8') as file:
- content = file.read()
-
- # Define the old URL pattern and the new URL string
- old_url_pattern = f'https://github.com/fermyon/developer/blob/main/content/{old_url_path}.md'
- new_url_string = f'https://github.com/fermyon/developer/blob/main/content/{new_url_path}.md'
-
- # Update the URL in the front matter
- updated_content = content.replace(old_url_pattern, new_url_string)
-
- # Write the updated content back to the file
- with open(file_path, 'w', encoding='utf-8') as file:
- file.write(updated_content)
-
- print(f"Updated URL in: {file_path}")
-
-
-file_path = "mapping_information.xlsx"
-mapping_information = read_excel_to_dict(file_path)
-
-directory_prefix = construct_paths(base_directory, *markdown_file_subdirectories)[0]
-
-for entry in mapping_information:
- original_file_path = os.path.join(directory_prefix, entry['original_file_path'])
- unified_file_path = os.path.join(directory_prefix, entry['unified_file_path'])
- # Update the URL in the markdown file
- try:
- update_url_in_markdown(original_file_path, entry['original_file_path'], entry['unified_file_path'])
- shutil.move(original_file_path, unified_file_path)
- print(f"Moved: {original_file_path} to {unified_file_path}")
- except FileNotFoundError:
- print(f"File not found: {original_file_path}")
- except Exception as e:
- print(f"Error updating {original_file_path} and {unified_file_path}: {e}")
\ No newline at end of file
diff --git a/migration_scripts/reset_content.sh b/migration_scripts/reset_content.sh
deleted file mode 100755
index fe8898c11..000000000
--- a/migration_scripts/reset_content.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-rm -rf ../content
-cp -rp ./content_backup ../content
-
diff --git a/migration_scripts/sidebar_structure.py b/migration_scripts/sidebar_structure.py
deleted file mode 100644
index 023edfdec..000000000
--- a/migration_scripts/sidebar_structure.py
+++ /dev/null
@@ -1,159 +0,0 @@
-sidebar_structure = {
- "toc": [
- [
- "Quick Start - Create Your First App With Spin",
- "Wasm Language Guides",
- [
- "Language Support Overview",
- "Rust",
- "Go",
- "Javascript",
- "Python",
- "Other Languages"
- ],
- "Creating Apps With Spin",
- [
- "Get Started",
- [
- "Introduction",
- "Install",
- "Upgrade",
- "Resources (Discord link etc.)"
- ],
- "Concepts",
- [
- "Learn About Spin App Fundamentals - Trigger, Components, and Application Manifest",
- "Learn About Spin Internal Data Layout",
- "Learn About Spin App Swappable Resources - Runtime configuration"
- ],
- "How To",
- [
- "Applications",
- [
- "Writing Applications",
- "Structuring Applications",
- "Compiling Applications",
- "Running Applications",
- "Publishing and Distribution",
- "Observing Applications",
- "Troubleshooting Application Development"
- ],
- "Triggers",
- [
- "Triggers",
- "The HTTP Trigger",
- "The Redis Trigger",
- "Building Custom Triggers - Extending and Embedding Spin"
- ],
- "API Guides",
- [
- "API Support Overview",
- "Storage",
- [
- "Key Value Store",
- "SQLite Storage",
- "Redis Storage",
- "Relational Database Storage"
- ],
- "Outbound connectivity",
- [
- "Making HTTP Requests",
- "MQTT Messaging"
- ],
- "Serverless AI",
- "Application Variables"
- ],
- "Tools",
- [
- "Templates",
- [
- "Creating Spin Templates",
- "Managing Templates"
- ],
- "Plugins",
- [
- "Creating Spin Plugins",
- "Managing Plugins"
- ],
- "Triggers"
- ]
- ],
- "Tutorials",
- [
- "Build Your First Serverless AI App",
- "Sentiment Analysis With Serverless AI",
- "Building a URL Shortener With Spin",
- "Spin Apps in Registries",
- "Spin Key-Value Store"
- ]
- ],
- "Deploying your Spin App",
- [
- "Fermyon Cloud",
- [
- "Get Started",
- [
- "Introduction",
- "Quickstart"
- ],
- "Applications",
- [
- "Develop a Spin Application",
- "Deploy an Application",
- "Upgrade an Application",
- "Delete an Application"
- ],
- "Concepts",
- [
- "The Fermyon Cloud",
- "Deployment Concepts",
- "Custom Domain",
- "Linking Apps To Resources Using Labels"
- ],
- "Tutorials",
- [
- "Using VS Code Extension",
- "Cloud Key-Value Store",
- "Persisting Data With SQLite Database",
- "Persisting Data With Redis",
- "Persisting Data With PostgreSQL",
- "Deploying Spin Apps Using GitHub Action",
- "Apply Custom Fermyon Subdomain",
- "Apply Custom Domain",
- "Configuring App Variables and Secrets"
- ],
- "Support",
- [
- "The User Settings Screen",
- "Quotas, Limitations, and Technical FAQ",
- "Pricing and Billing",
- "How to Get Help?"
- ]
- ],
- "Fermyon Platform For Kubernetes",
- [
- "Kubernetes",
- [
- "Spin on Kubernetes",
- "Spin in Pods (Legacy)"
- ]
- ]
- ],
- "References",
- [
- "CLI Reference",
- "Application Manifest (Version 1) Reference",
- "Application Manifest Reference"
- ],
- "Contributing",
- [
- "Contributing to Docs",
- "Contributing to Spin",
- [
- "Spin Improvement Proposals"
- ],
- "Contributing to SpinKube"
- ]
- ]
- ]
-}
diff --git a/toolkit/README.md b/toolkit/README.md
deleted file mode 100644
index 7a878d4bd..000000000
--- a/toolkit/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-- [Supporting Documentation](#supporting-documentation)
- - [Prerequisites](#prerequisites)
- - [Python3](#python3)
- - [Curl](#curl)
-- [Write Codeblocks](#write-codeblocks)
- - [Install Python Dependencies](#install-python-dependencies)
- - [Write Codeblocks Usage](#write-codeblocks-usage)
-- [Check CLI Output](#check-cli-output)
- - [Check CLI Output Usage](#check-cli-output-usage)
-
-# Supporting Documentation
-
-If you are using this toolkit to add/edit the current documentation, please read the [contributing documentation](https://spinframework.dev/v2/contributing-docs) page (and perhaps leave it open for reference when forking, cloning, committing, etc.).
-
-# Developer Repository Location
-
-We will use the system's home directory for demonstration purposes (and assume that the developer repository is also in the home directory for demonstration purposes i.e. `~/developer`). Let's change to the home directory and clone the repository:
-
-```bash
-cd ~
-git clone https://github.com/fermyon/developer.git
-```
-
-## Prerequisites
-
-### Python3
-
-Ensure that you have installed Python 3.10 or later on your system. You can check your Python version by running:
-
-```bash
-python3 --version
-```
-
-### Curl
-
-Ensure that you have `curl` installed. For example, the `curl` dependency can be installed on Ubuntu Linux using the following commands:
-
-```bash
-sudo apt update
-sudo apt install curl
-curl --version
-```
-
-# Write Codeblocks
-
-The `update_spin_cli_reference.py` script will fetch the current [Spin CLI Reference](https://spinframework.dev/v2/cli-reference) document from the web and write a fresh copy of the source markdown file (a new file called `updated_markdown.md` with the new version of code blocks added). The fresh markdown file, generated by this script, is the basis of a PR that contains the CLI commands for the new version of Spin.
-
-## Install Python Dependencies
-
-The Python code that writes the codeblocks needs to have the Python `requests` library installed. We do this inside a Python Virtual Environment (`venv`) dir.
-
-Change into an arbitrary working directory so as not to add versioned files to this repository. (The files created by this toolkit are auxiliary and are manually inserted into the versioned documentation files.)
-
-Set up and activate a Python virtual environment and then install the dependencies:
-
-```bash
-# Using home
-cd ~
-# Create venv
-python3 -m venv venv-dir
-# Activate venv
-source venv-dir/bin/activate
-# Install requests library
-pip3 install requests
-```
-
-## Write Codeblocks - Usage
-
-Run the script and pass in the two versions of Spin.
-
-**Note**: Use two number characters `vX.X` only i.e. `v2.6`:
-
-```bash
-python3 developer/toolkit/update_spin_cli_reference.py v2.6 v2.7
-```
-
-The above script generates a new file called `updated_markdown.md`. Open this file and use the markdown as the basis for your new Spin CLI Reference PR.
-
-# Check CLI Output
-
-The `script_to_check_cli_outputs.sh` script will tell you what the changes are (between two different Spin versions) the script is designed to quickly provide the necessary information for a new Spin CLI Reference PR.
-
-## Check CLI Output - Usage
-
-Run the script using the `vX.X.X` format. Please note, the Spin versions you use must exist as a Spin release in the Spin GitHub repo.
-
-**Note**: Use three number characters `vX.X.X` i.e. `v2.6.0`:
-
-```bash
-# Assuming this repo is cloned to your home directory (as per the first example also)
-cd ~
-cd developer/toolkit
-# Run the script
-./script_to_check_cli_outputs.sh v2.5.0 v2.6.0
-```
-
-The output will show old content on the `<` prefixed lines and new content on the `>` prefixed lines. If there have been no changes to the CLI (other than the version and checksum) you will see something similar to the following:
-
-```bash
-< Output: spin 2.5.0 (83eb68d 2024-05-08)
-
-> Output: spin 2.6.0 (a4ddd39 2024-06-20)
-```
diff --git a/toolkit/check_cli_output.py b/toolkit/check_cli_output.py
deleted file mode 100644
index e3cd442f6..000000000
--- a/toolkit/check_cli_output.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import subprocess
-import re
-
-def get_help_output(command):
- try:
- result = subprocess.run(command.split(), capture_output=True, text=True)
- return result.stdout
- except Exception as e:
- print(f"Failed to run command {command}: {e}")
- return ""
-
-def extract_subcommands(help_output):
- subcommands = []
- subcommands_section = None
- sections = re.split(r'(SUBCOMMANDS:\s*)', help_output, flags=re.IGNORECASE)
- if len(sections) > 1:
- subcommands_section = sections[2]
-
- if subcommands_section:
- lines = subcommands_section.splitlines()
- for line in lines:
- match = re.match(r'^\s*([a-zA-Z0-9*-]+)\s', line)
- if match:
- subcommand = match.group(1).strip()
- subcommands.append(subcommand)
- cleaned_list = [subcommand.replace('*', '') for subcommand in subcommands if subcommand != '*']
- return cleaned_list
-
-def recursive_help(command, indent=0, visited=None):
- if visited is None:
- visited = set()
-
- if command in visited:
- return
-
- visited.add(command)
-
- help_output = get_help_output(command)
- print(f"{' ' * indent}Command: {command}")
- print(f"{' ' * indent}Output: {help_output}")
-
- subcommands = extract_subcommands(help_output)
- for subcommand in subcommands:
- base_command = ' '.join(command.split()[:-1])
- full_command = f"{base_command} {subcommand} --help"
- if full_command in visited:
- continue
- print(f"{' ' * indent}Processing subcommand: {subcommand}")
- print(f"{' ' * indent}{full_command}")
- recursive_help(full_command, indent + 2, visited)
-
-if __name__ == "__main__":
- recursive_help("./spin --help")
-
diff --git a/toolkit/script_to_check_cli_outputs.sh b/toolkit/script_to_check_cli_outputs.sh
deleted file mode 100755
index f89d744f7..000000000
--- a/toolkit/script_to_check_cli_outputs.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-if [ $# -ne 2 ]; then
- echo "Usage: $0 "
- echo "Usage: $0 v2.5.0 v2.6.0"
- exit 1
-fi
-SPIN_CURRENT=$1
-SPIN_LATEST=$2
-SPIN_CURRENT_TMP=$(mktemp -d tmp.XXXXXX)
-echo "Temporary directory created at: $SPIN_CURRENT_TMP"
-SPIN_LATEST_TMP=$(mktemp -d tmp.XXXXXX)
-echo "Temporary directory created at: $SPIN_LATEST_TMP"
-SPIN_CURRENT_INSTALL_DIR="$SPIN_CURRENT_TMP/$SPIN_CURRENT"
-SPIN_LATEST_INSTALL_DIR="$SPIN_LATEST_TMP/$SPIN_LATEST"
-mkdir $SPIN_CURRENT_INSTALL_DIR
-mkdir $SPIN_LATEST_INSTALL_DIR
-cp -rp check_cli_output.py $SPIN_CURRENT_INSTALL_DIR
-cp -rp check_cli_output.py $SPIN_LATEST_INSTALL_DIR
-cd $SPIN_CURRENT_INSTALL_DIR
-curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash -s -- -v $SPIN_CURRENT
-python3 check_cli_output.py > $SPIN_CURRENT
-cd ../../
-cd $SPIN_LATEST_INSTALL_DIR
-curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash -s -- -v $SPIN_LATEST
-python3 check_cli_output.py > $SPIN_LATEST
-cd ../../
-diff $SPIN_CURRENT_INSTALL_DIR/$SPIN_CURRENT $SPIN_LATEST_INSTALL_DIR/$SPIN_LATEST
-rm -r tmp.*
diff --git a/toolkit/update_spin_cli_reference.py b/toolkit/update_spin_cli_reference.py
deleted file mode 100644
index 4ad7919e8..000000000
--- a/toolkit/update_spin_cli_reference.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import requests
-import sys # Import sys to access command line arguments
-
-url = "https://raw.githubusercontent.com/spinframework/spin-docs/main/content/v2/cli-reference.md"
-
-def download_markdown(url):
- response = requests.get(url)
- response.raise_for_status()
- return response.text
-
-def update_markdown_content(content, current_version, new_version):
- updated_content = ""
- blocks = content.split('{{ blockEnd }}')
-
- for block in blocks[:-1]:
- updated_content += block + '{{ blockEnd }}'
- if f'{{ startTab "{current_version}"}}' in block:
- new_block = block.replace(f'{{ startTab "{current_version}"}}', f'{{ startTab "{new_version}"}}')
- updated_content += new_block + '{{ blockEnd }}\n'
- updated_content += blocks[-1]
-
- return updated_content
-
-def save_updated_content(content, filename="updated_markdown.md"):
- with open(filename, "w") as file:
- file.write(content)
-
-def main():
- if len(sys.argv) != 3:
- print("Usage: python3 update_spin_cli_reference.py ")
- print("Usage: python3 update_spin_cli_reference.py v2.6 v2.7")
- sys.exit(1)
-
- current_version = sys.argv[1]
- new_version = sys.argv[2]
- original_content = download_markdown(url)
- updated_content = update_markdown_content(original_content, current_version, new_version)
- save_updated_content(updated_content)
- print("Updated markdown has been saved.")
-
-if __name__ == "__main__":
- main()