Skip to main content

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) in mkdocs.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.json for 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"]
      techdocs_no_docker: true

Config reference

  • versions (list): list of one-entry maps where key = version label and value = git branch/tag
    • Example: - v2: release/2.0
  • root_version_name (string, default: root): display name written for the default/root docs version in multiversion.json
  • site_subdir_prefix (string, default: __): prefix for version output folders under site/
  • manifest_filename (string, default: multiversion.json): manifest filename under site/
  • techdocs_cli_command (list, default: ["techdocs-cli"]): command used to run TechDocs generation
  • techdocs_no_docker (bool, default: true): appends --no-docker to techdocs-cli generate

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+
  • mkdocs
  • git available on PATH
  • techdocs-cli available on PATH (or configure techdocs_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

mkdocs_techdocs_version_selector-0.1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mkdocs_techdocs_version_selector-0.1.2.tar.gz.

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6c6d6addb61e60fe35d4d61269f5c2b406d25f8cf3465518f33cc630da4b3b22
MD5 3db2ffff3df1e252aa1bd7014874166f
BLAKE2b-256 5f75ab9f63c95cf1117679d2a7c2ac9b04654975ccec3f6c3c3c4397f0509708

See more details on using hashes here.

File details

Details for the file mkdocs_techdocs_version_selector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efe9162f8d12e18ca04a51e66762789f83a1e05402fa98285d1147d98944184e
MD5 dd976d224057432f7bedce39b138e979
BLAKE2b-256 8217824640cc25441d1494362e64bd5178f426d78df9d4dc153f9980bb0a6324

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page