Skip to main content

mkdocs-gitsvg

MkDocs plugin that renders gitsvg git-graph diagrams from fenced code blocks to inline SVG at build time.

CI PyPI Python 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

pip install mkdocs-gitsvg

Usage

Enable the plugin in mkdocs.yml:

plugins:
  - gitsvg

Then draw a git graph in any page with a ```gitsvg fenced block whose body is a gitsvg JSONL op-stream:

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

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 for the full reference.

License

MIT — see LICENSE.

Metadata

Release files for mkdocs-gitsvg 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-gitsvg 0.1.0
File Size Uploaded
mkdocs_gitsvg-0.1.0.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-gitsvg 0.1.0
File Interpreter ABI Platform
mkdocs_gitsvg-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / mkdocs_gitsvg-0.1.0.tar.gz

Download URL mkdocs_gitsvg-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e09311005ecf4e04f7ffb6c349dcba820e65b0480fe6862216554bf65883d66b
BLAKE2b-256 checksum
How to use checksums
10ec9a19495a82a9019798af4347be3774e29f195f4cee7771b8396c47de889f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.

Transparency log

Release files / mkdocs_gitsvg-0.1.0-py3-none-any.whl

Download URL mkdocs_gitsvg-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9c000b57a111df5d64e1624ea60f6453c037a911d3258177aa231861fb62b7d
BLAKE2b-256 checksum
How to use checksums
7cd080ff2018ab50ace56b9f9357a4977f406d69f160845686b2cb447f47b195
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page