From a4d1f51b1b9e3773918ec544ea5c441419971e06 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 22 Feb 2022 21:45:14 +0100 Subject: [PATCH] fix template auto-formatting --- exampleSite/content/en/shortcodes/katex.md | 2 +- layouts/shortcodes/katex.html | 8 +++++--- layouts/shortcodes/mermaid.html | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/exampleSite/content/en/shortcodes/katex.md b/exampleSite/content/en/shortcodes/katex.md index d9d7392..0fd8458 100644 --- a/exampleSite/content/en/shortcodes/katex.md +++ b/exampleSite/content/en/shortcodes/katex.md @@ -26,7 +26,7 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {{< /columns >}} -KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with a `display` setting. for example `display: block`: +KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter (e.g. `display: block`): diff --git a/layouts/shortcodes/katex.html b/layouts/shortcodes/katex.html index 0f1f66a..3ab6b2f 100644 --- a/layouts/shortcodes/katex.html +++ b/layouts/shortcodes/katex.html @@ -1,12 +1,14 @@ + {{ if not (.Page.Scratch.Get "katex") }} - + + /> + {{ .Page.Scratch.Set "katex" true }} {{ end }} - + {{ cond (in .Params "display") "\\[" "\\(" -}} diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html index 0d5faba..7133016 100644 --- a/layouts/shortcodes/mermaid.html +++ b/layouts/shortcodes/mermaid.html @@ -1,8 +1,10 @@ + {{ if not (.Page.Scratch.Get "mermaid") }} - + + {{ .Page.Scratch.Set "mermaid" true }} {{ end }} - +
   {{- .Inner -}}