MkDocs plugin that builds TechDocs versions from catalog-info.yaml
Project description
mkdocs-techdocs-version-selector
MkDocs plugin that builds versioned TechDocs static sites from version mappings defined directly in mkdocs.yml.
What it does
- Reads versions from plugin config (
versions) inmkdocs.yml - Does nothing when there are no configured versions or only one configured version
- Builds each configured git branch/tag into a dedicated subdirectory (for example
site/__v2,site/__v3) - Writes
multiversion.jsonfor the TechDocs version selector - Adds a root/default manifest entry using
root_version_name(with path/) - Prevents recursive re-execution during child version builds
Installation
pip install mkdocs-techdocs-version-selector
Configuration
Configure the plugin in mkdocs.yml:
plugins:
- techdocs-version-selector:
root_version_name: latest
versions:
- v2: v2
- v3: v3
site_subdir_prefix: "__"
manifest_filename: multiversion.json
techdocs_cli_command: ["techdocs-cli"]
Config reference
versions(list): list of one-entry maps where key = version label and value = git branch/tag- Example:
- v2: release/2.0
- Example:
root_version_name(string, default:root): display name written for the default/root docs version inmultiversion.jsonsite_subdir_prefix(string, default:__): prefix for version output folders undersite/manifest_filename(string, default:multiversion.json): manifest filename undersite/techdocs_cli_command(list, default:["techdocs-cli"]): command used to run TechDocs generation
Example multiversion.json
After a successful build, site/multiversion.json will look like:
{
"latest": {
"name": "latest",
"latest": true,
"path": "/"
},
"v2": {
"name": "v2",
"latest": false,
"ref": "v2",
"path": "/__v2/"
},
"v3": {
"name": "v3",
"latest": false,
"ref": "v3",
"path": "/__v3/"
}
}
Requirements
- Python 3.9+
mkdocsgitavailable onPATHtechdocs-cliavailable onPATH(or configuretechdocs_cli_command)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_techdocs_version_selector-0.1.3.tar.gz.
File metadata
- Download URL: mkdocs_techdocs_version_selector-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07c32860184a554119c8ab36fd80b0a1011a622e0ff8ec7efaef853e0f553e72
|
|
| MD5 |
5df3112ce39120e7fa75be3cc3fb06e7
|
|
| BLAKE2b-256 |
26870c036fe73ca89893c788a41b7b9423b5c92b0f2ee1e9584e53dedfd33cc1
|
File details
Details for the file mkdocs_techdocs_version_selector-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mkdocs_techdocs_version_selector-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b80dfc75ff4d07adc6e05b226276c339be67b4336b157b79507373bf3c8e62ac
|
|
| MD5 |
eb749dde38565504287bcbc93d270f2b
|
|
| BLAKE2b-256 |
cd72dcccd141127cb7c0564c05c5f4c21da7b3323a11b1c94c97d3aa017ab9e2
|