Skip to content

Commit 139e443

Browse files
committed
graphviz: allow overriding the engine
This can be done like so: {{< graphviz engine="neato" >}} Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f0dadd7 commit 139e443

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

layouts/_default/baseof.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ <h1 data-pagefind-meta="title">About{{ if (isset .Params "subtitle") }} - {{ .Pa
202202
graphAttributes: {
203203
bgcolor: "transparent",
204204
},
205+
engine: x.getAttribute("engine") || "dot",
205206
}
206207
const svg = vizInstance.renderSVGElement(x.innerText, options)
207208
svg.classList.add("graphviz")

layouts/shortcodes/graphviz.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<pre class="graphviz">
1+
<pre class="graphviz"{{ if (ne "" (.Get "engine")) }} engine="{{(.Get "engine")}}"{{ end }}>
22
{{ .Inner | htmlEscape | safeHTML }}
33
</pre>
44
{{ .Page.Store.Set "hasGraphviz" true }}

0 commit comments

Comments
 (0)