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"]

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

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.4.tar.gz (5.2 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.4.tar.gz.

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9a774eca6320e0fd9a732c6cf77512cbbb34223254099d85f314e4b838e98c93
MD5 29eada95081b76f6a317a6ded27bae86
BLAKE2b-256 ba1d1b0bea03d78387d2ef6aac2612249aacd17c302c80510eefec0e7d54e20d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 473f74c3307598030270014cc74aadf3651fa8541747352ac78c56a985884484
MD5 afcc787a19ef54553fcee39dd8548bbe
BLAKE2b-256 ce42904395995eaf3caa5ca397c69ae7ddf6ef1582e629efd086fd29156da978

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