Metadata-Version: 2.4
Name: mkdocs-markgraf
Version: 0.1.16
Summary: MkDocs plugin that renders markgraf animations using the Canvas2D embed bundle.
Author-email: Mark Eibes <mark.eibes@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Mark Eibes
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/markgrafhq/mkdocs-markgraf
Project-URL: Source, https://github.com/markgrafhq/mkdocs-markgraf
Project-URL: Issues, https://github.com/markgrafhq/mkdocs-markgraf/issues
Keywords: mkdocs,mkdocs-plugin,markgraf,animation,diagram,documentation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mkdocs>=1.5
Dynamic: license-file

# mkdocs-markgraf

MkDocs plugin that renders [markgraf](https://github.com/i-am-the-slime/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

```bash
pip install mkdocs-markgraf
```

## Use

`mkdocs.yml`:

```yaml
plugins:
  - markgraf
```

Inside a page:

````markdown
```markgraf
seed 1

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

keyframe 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:

````markdown
```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`:

```yaml
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.
