Add mermaid for rendering graphs and other diagrams

This commit is contained in:
Lol3rrr
2026-02-21 02:33:24 +01:00
parent 01afd2dd1c
commit b09c8f455c
4 changed files with 2875 additions and 0 deletions

View File

@@ -39,6 +39,14 @@ Setup the benchmark itself:
5. `mount /dev/rbd0 /mnt/bench` 5. `mount /dev/rbd0 /mnt/bench`
## Benchmarks ## Benchmarks
{% mermaid() %}
xychart
title "Random Read"
x-axis "Block Size" ["4k", "8k", "4M", "8M"]
y-axis "IOPS" 0000 --> 5000
bar [0, 0, 0, 0]
{% end %}
## TODO ## TODO
- Try directly on the block device - Try directly on the block device

2843
static/js/mermaid.min.js vendored Normal file

File diff suppressed because one or more lines are too long

21
templates/_base.html Normal file
View File

@@ -0,0 +1,21 @@
{% extends "radion/templates/_base.html" %}
{% block scripts %}
{{ super() }}
<!-- mermaid -->
<!-- Based on the following blog -->
<!-- https://www.hahwul.com/dev/zola/mermaid-in-zola/ -->
<script src="/js/mermaid.min.js"></script>
<script type="module">
mermaid.initialize({ startOnLoad: false, theme: 'dark' });
document.addEventListener('DOMContentLoaded', async () => {
const mermaidElements = document.querySelectorAll('.mermaid');
if (mermaidElements.length > 0) {
await mermaid.run({
nodes: mermaidElements
});
}
});
</script>
{% endblock %}

View File

@@ -0,0 +1,3 @@
<pre class="mermaid">
{{ body }}
</pre>