Metadata-Version: 2.4
Name: mkdocs-gitsvg
Version: 0.1.0
Summary: MkDocs plugin that renders gitsvg git-graph diagrams from fenced code blocks to inline SVG.
Project-URL: Documentation, https://mkdocs-gitsvg.readthedocs.io/
Project-URL: Source, https://github.com/bertpl/mkdocs-gitsvg
Project-URL: Changelog, https://github.com/bertpl/mkdocs-gitsvg/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/bertpl/mkdocs-gitsvg/issues
Author-email: Bert Pluymers <bert.pluymers@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: diagram,documentation,git,mkdocs,mkdocs-plugin,svg
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.11
Requires-Dist: gitsvg>=0.2.7
Requires-Dist: mkdocs>=1.5
Requires-Dist: pymdown-extensions>=10.0
Description-Content-Type: text/markdown

# mkdocs-gitsvg

MkDocs plugin that renders [gitsvg](https://github.com/bertpl/gitsvg) git-graph
diagrams from fenced code blocks to inline SVG at build time.

[![CI](https://img.shields.io/github/actions/workflow/status/bertpl/mkdocs-gitsvg/push_to_main.yml?branch=main&label=CI)](https://github.com/bertpl/mkdocs-gitsvg/actions/workflows/push_to_main.yml)
[![PyPI](https://img.shields.io/pypi/v/mkdocs-gitsvg.svg)](https://pypi.org/project/mkdocs-gitsvg/)
[![Python](https://img.shields.io/pypi/pyversions/mkdocs-gitsvg.svg)](https://pypi.org/project/mkdocs-gitsvg/)
[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/bertpl/mkdocs-gitsvg/blob/main/LICENSE)

No client-side JavaScript: diagrams are rendered server-side at build time, so
they work in any browser and in offline / PDF exports.

## Installation

```bash
pip install mkdocs-gitsvg
```

## Usage

Enable the plugin in `mkdocs.yml`:

```yaml
plugins:
  - gitsvg
```

Then draw a git graph in any page with a ` ```gitsvg ` fenced block whose body
is a [gitsvg](https://github.com/bertpl/gitsvg) JSONL op-stream:

````markdown
```gitsvg
{"op": "branch", "name": "main", "label_side": "before"}
{"op": "commit", "branch": "main", "id": "c1", "msg": "initial commit", "hash": "auto"}
{"op": "commit", "branch": "main", "id": "c2", "msg": "add README", "hash": "auto"}
```
````

The block renders to an inline SVG git graph in the built site.

## Configuration

The plugin needs no configuration. Available options (with defaults):

```yaml
plugins:
  - gitsvg:
      fence_name: gitsvg          # fenced-block language tag to intercept
      css_class: gitsvg-diagram   # class on the wrapper <div>
      on_error: warn              # warn | raise | show
```

`on_error` controls what happens when a diagram fails to render: `warn`
(default) shows an error box and logs a warning (so `mkdocs build --strict`
fails), `raise` fails the build immediately, and `show` shows the box silently.
A bundled stylesheet is linked automatically. See the
[documentation site](https://github.com/bertpl/mkdocs-gitsvg) for the full
reference.

## License

MIT — see [LICENSE](LICENSE).
