MkDocs plugin that renders gitsvg git-graph diagrams from fenced code blocks to inline SVG.
Project description
mkdocs-gitsvg
MkDocs plugin that renders gitsvg git-graph diagrams from fenced code blocks to inline SVG at build time.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_gitsvg-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_gitsvg-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09311005ecf4e04f7ffb6c349dcba820e65b0480fe6862216554bf65883d66b
|
|
| MD5 |
3143eebeb450349003b862546bad8000
|
|
| BLAKE2b-256 |
10ec9a19495a82a9019798af4347be3774e29f195f4cee7771b8396c47de889f
|
Provenance
The following attestation bundles were made for mkdocs_gitsvg-0.1.0.tar.gz:
Publisher:
release_tag.yml on bertpl/mkdocs-gitsvg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_gitsvg-0.1.0.tar.gz -
Subject digest:
e09311005ecf4e04f7ffb6c349dcba820e65b0480fe6862216554bf65883d66b - Sigstore transparency entry: 1710244903
- Sigstore integration time:
-
Permalink:
bertpl/mkdocs-gitsvg@e21eedda1590ccf8600134cc4d883a7a6585387c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bertpl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_tag.yml@e21eedda1590ccf8600134cc4d883a7a6585387c -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_gitsvg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_gitsvg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9c000b57a111df5d64e1624ea60f6453c037a911d3258177aa231861fb62b7d
|
|
| MD5 |
dfc243ebc4e4f8b2f1df84020634cd72
|
|
| BLAKE2b-256 |
7cd080ff2018ab50ace56b9f9357a4977f406d69f160845686b2cb447f47b195
|
Provenance
The following attestation bundles were made for mkdocs_gitsvg-0.1.0-py3-none-any.whl:
Publisher:
release_tag.yml on bertpl/mkdocs-gitsvg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_gitsvg-0.1.0-py3-none-any.whl -
Subject digest:
e9c000b57a111df5d64e1624ea60f6453c037a911d3258177aa231861fb62b7d - Sigstore transparency entry: 1710244942
- Sigstore integration time:
-
Permalink:
bertpl/mkdocs-gitsvg@e21eedda1590ccf8600134cc4d883a7a6585387c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bertpl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_tag.yml@e21eedda1590ccf8600134cc4d883a7a6585387c -
Trigger Event:
push
-
Statement type: