Skip to main content

MkDocs plugin that renders markgraf animations using the Canvas2D embed bundle.

Project description

mkdocs-markgraf

MkDocs plugin that renders markgraf animations inside documentation pages.

Fenced ```markgraf blocks become an interactive Canvas2D player with a scrub bar, keyframe ticks, play/pause, and speed control. The bundled JS/CSS ships with the plugin — no CDN, no external dependencies at runtime.

Install

pip install mkdocs-markgraf

Use

mkdocs.yml:

plugins:
  - markgraf

Inside a page:

```markgraf
seed 1

frame v1 {
  +node client "Client"
  +node api "API"
  +node db "Database"
  +edge client api
  +edge api db
  client -> api "GET /user/42"
  api -> db "SELECT"
}

frame v2 {
  +node cache "Cache"
  -edge api db
  +edge api cache
  client -> api "GET /user/42"
  api -> cache "HIT"
}
```

Sizing

Constrain the embed via fence attributes:

```markgraf height=320

```

```markgraf width=420

```

```markgraf height=80svh

```

Values default to px; svh, vh, dvh, %, em, rem are accepted as explicit units. height clamps max-height on the canvas; width clamps max-width on the embed container.

Player controls

  • Click the canvas or press Space anywhere to toggle play/pause.
  • Click ticks on the scrub bar to jump between keyframes.
  • Only one embed plays at a time — starting one pauses the others.
  • The control bar is overlaid on the canvas and only shown on hover or focus.

Configuration

mkdocs.yml:

plugins:
  - markgraf:
      assets_subdir: assets/markgraf  # where to copy the bundled JS/CSS
      js_path: /path/to/markgraf-embed.js   # override the bundled JS
      css_path: /path/to/markgraf-embed.css # override the bundled CSS

License

MIT.

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_markgraf-0.1.9.tar.gz (107.3 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_markgraf-0.1.9-py3-none-any.whl (107.2 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_markgraf-0.1.9.tar.gz.

File metadata

  • Download URL: mkdocs_markgraf-0.1.9.tar.gz
  • Upload date:
  • Size: 107.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mkdocs_markgraf-0.1.9.tar.gz
Algorithm Hash digest
SHA256 99c67ec691a77c8662fe08a742e3d8bc594426926ff4079a165d18cc27d84f23
MD5 1d8bfc7b9cfc66890a27975d72b21f1d
BLAKE2b-256 2ec29675f4e02e2be71ef1177a31ff252c4def92000ada01c9c3b33e6d335b8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_markgraf-0.1.9.tar.gz:

Publisher: publish.yml on markgrafhq/mkdocs-markgraf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_markgraf-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_markgraf-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 107.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mkdocs_markgraf-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6f33534c6b89e8af729b7a932cd8b187ac71f432ae2d503e56c3f766f917a4
MD5 b44ddda12bf759b86506aa98b294a98f
BLAKE2b-256 6d7d30aadf3d74b99db7b27ebd246f94b22676b7e286c56bb1fcf6aa4bf1ce12

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_markgraf-0.1.9-py3-none-any.whl:

Publisher: publish.yml on markgrafhq/mkdocs-markgraf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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