Skip to main content

MkDocs CRD Viewer

mkdocs-crd-viewer renders Kubernetes CRD schemas as interactive, expandable tree views inside MkDocs pages.

The package provides:

  • crd-viewer MkDocs plugin for CSS/JS asset wiring.
  • crd_viewer(...) macro for rendering CRD schemas from Markdown.

Install

uv sync

Or install directly from GitHub with uv add:

uv add "mkdocs-crd-viewer @ git+https://github.com/eda-labs/mkdocs-crd-viewer@main"

Replace @main with a tag if you want a fixed release (for example @v0.1.0).

Configure

In your mkdocs.yml:

plugins:
  - search
  - crd-viewer
  - macros:
      modules:
        - mkdocs_crd_viewer.macros

If you need custom Jinja delimiters, the demo config in demo/mkdocs.yml shows a working setup with -{{ ... }}-.

Macro Reference

There is currently one macro:

crd_viewer(path, version=None, title=None, collapsed=False, show_status=True)
Parameter Type Default Description
path str required Relative or absolute path to a CRD YAML file. Relative paths resolve from the MkDocs project root.
version str | None storage version CRD version to render. Falls back to storage, then served, then first entry.
title str | None selected kind Override the viewer title.
collapsed bool False Render inside a collapsed <details> wrapper.
show_status bool True Include the status schema section when available.

Each file should contain exactly one CustomResourceDefinition document.

Usage Patterns

Default call:

-{{ crd_viewer("crds/fabrics.eda.nokia.com.yaml") }}-

Select a specific version and custom title:

-{{ crd_viewer("crds/fabrics.eda.nokia.com.yaml", version="v1alpha1", title="Fabric (v1alpha1)") }}-

Collapsed/spec-only view:

-{{ crd_viewer("crds/fabrics.eda.nokia.com.yaml", collapsed=True, show_status=False) }}-

Plugin Configuration

crd-viewer accepts:

Option Type Default Description
asset_dir str assets/mkdocs-crd-viewer Output path (inside site_dir) for crd-viewer.css and crd-viewer.js.

Demo and Tests

Run the demo site:

uv run mkdocs serve -f demo/mkdocs.yml

Run tests:

uv run pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_crd_viewer-0.2.2.tar.gz (53.7 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_crd_viewer-0.2.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_crd_viewer-0.2.2.tar.gz.

File metadata

  • Download URL: mkdocs_crd_viewer-0.2.2.tar.gz
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mkdocs_crd_viewer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 492fd200ccb96f87c1e293f9b22223e76c66b7172deb94e06fa1bf9474d5dc41
MD5 0cf60e455826e16dddb1010422c75dd5
BLAKE2b-256 f32c4bdb3359d9d15cedbc7a3ff734be199c633affc39997fa58b8b5ad3b244b

See more details on using hashes here.

File details

Details for the file mkdocs_crd_viewer-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_crd_viewer-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mkdocs_crd_viewer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 588cb4121fad9cbbd8c51f69e59b19ea5ae63c718be08ca5583c85d4f264f66c
MD5 055dbd0872e75d81bfd7a30f01873dfc
BLAKE2b-256 95cf2e66b667068164396771fb8d0f6bfb7a51fa04a12b8af3b4cb9b317f7deb

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 Sentry Error logging StatusPage Status page