Skip to main content

MkDocs plugin and macros helper for rendering Kubernetes CRD schemas as interactive trees.

Project description

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

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_crd_viewer-0.2.1.tar.gz (53.8 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.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_crd_viewer-0.2.1.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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.1.tar.gz
Algorithm Hash digest
SHA256 9acaec3cbf3d456a63d7e76811b4620c04067331383bedb45b244b1a15a1f8ad
MD5 76652b39d62ce745eef283bef96b2ca1
BLAKE2b-256 e32025b0bd32c10158b78799734617f2e8e46a10c5364481fab2ffb551b1aa15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkdocs_crd_viewer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7282309f491ac08b824e8710d439fc3cdff97d6bc12fcd403213819d08f8b776
MD5 95d77727a0041de78c29abef7b6bb522
BLAKE2b-256 aa0d15cae1af23350dc882455d12949a0971a77b6be6abc895c11ba43c0e4f6b

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