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.3.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.3.tar.gz.

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.3.tar.gz
Algorithm Hash digest
SHA256 07c32860184a554119c8ab36fd80b0a1011a622e0ff8ec7efaef853e0f553e72
MD5 5df3112ce39120e7fa75be3cc3fb06e7
BLAKE2b-256 26870c036fe73ca89893c788a41b7b9423b5c92b0f2ee1e9584e53dedfd33cc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_techdocs_version_selector-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b80dfc75ff4d07adc6e05b226276c339be67b4336b157b79507373bf3c8e62ac
MD5 eb749dde38565504287bcbc93d270f2b
BLAKE2b-256 cd72dcccd141127cb7c0564c05c5f4c21da7b3323a11b1c94c97d3aa017ab9e2

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