docs: move mermaid shortcode documentation to shortcode page (#212)

This commit is contained in:
Robert Kaussow 2022-02-22 21:42:44 +01:00 committed by GitHub
parent 591ee8d6df
commit 357417f8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 173 additions and 420 deletions

View File

@ -1,54 +0,0 @@
---
title: Mermaid
date: 2021-05-23T20:00:00+01:00
authors:
- john-doe
tags:
- Documentation
- Shortcodes
---
[Mermaid](https://mermaidjs.github.io/) is library for generating SVG charts and diagrams from text.
<!--more-->
## Example
{{< columns >}}
<!-- prettier-ignore -->
```tpl
{{</* mermaid class="text-center"*/>}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{</* /mermaid */>}}
```
<--->
<!-- spellchecker-disable -->
<!-- prettier-ignore -->
{{< mermaid class="text-center" >}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{< /mermaid >}}
<!-- spellchecker-enable -->
{{< /columns >}}

View File

@ -267,6 +267,53 @@ prompts feud gait, quid exercise emeritus bis e. In pro quints consequent.
{{< /tab >}} {{< /tab >}}
{{< /tabs >}} {{< /tabs >}}
## Mermaid
[Mermaid](https://mermaidjs.github.io/) is library for generating SVG charts and diagrams from text.
<!--more-->
### Example
{{< columns >}}
<!-- prettier-ignore -->
```tpl
{{</* mermaid class="text-center"*/>}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{</* /mermaid */>}}
```
<--->
<!-- spellchecker-disable -->
<!-- prettier-ignore -->
{{< mermaid class="text-center" >}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{< /mermaid >}}
<!-- spellchecker-enable -->
{{< /columns >}}
## KaTeX ## KaTeX
[KaTeX](https://katex.org/) shortcode let you render math typesetting in markdown document. [KaTeX](https://katex.org/) shortcode let you render math typesetting in markdown document.
@ -293,7 +340,7 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /columns >}} {{< /columns >}}
KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter: KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter (e.g. `display: block`):
<!-- spellchecker-disable --> <!-- spellchecker-disable -->
<!-- prettier-ignore --> <!-- prettier-ignore -->

View File

@ -259,5 +259,4 @@ There are a lot more things to discover. To get the most out of the Theme we hav
- [Shortcodes](/posts/advanced/shortcodes/) - [Shortcodes](/posts/advanced/shortcodes/)
- [Advanced Images](/posts/post-with-images/) - [Advanced Images](/posts/post-with-images/)
- [Includes](/posts/advanced/includes/) - [Includes](/posts/advanced/includes/)
- [Mermaid](/posts/advanced/mermaid/)
- [Table of Content](/posts/advanced/toc/) - [Table of Content](/posts/advanced/toc/)

View File

@ -1,3 +1,4 @@
<!-- prettier-ignore-start -->
{{ if not (.Page.Scratch.Get "katex") }} {{ if not (.Page.Scratch.Get "katex") }}
<!-- Include katex only first time --> <!-- Include katex only first time -->
<link <link
@ -7,8 +8,9 @@
<script defer src="{{ index (index .Site.Data.assets "katex.js") "src" | relURL }}"></script> <script defer src="{{ index (index .Site.Data.assets "katex.js") "src" | relURL }}"></script>
{{ .Page.Scratch.Set "katex" true }} {{ .Page.Scratch.Set "katex" true }}
{{ end }} {{ end }}
<!-- prettier-ignore-end -->
<span class="gblog-katex"> <span class="gdoc-katex katex{{ with .Get "class" }}{{ . }}{{ end }}">
{{ cond (in .Params "display") "\\[" "\\(" -}} {{ cond (in .Params "display") "\\[" "\\(" -}}
{{- trim .Inner "\n" -}} {{- trim .Inner "\n" -}}
{{- cond (in .Params "display") "\\]" "\\)" }} {{- cond (in .Params "display") "\\]" "\\)" }}

View File

@ -1,8 +1,10 @@
<!-- prettier-ignore-start -->
{{ if not (.Page.Scratch.Get "mermaid") }} {{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time --><script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script> <!-- Include mermaid only first time -->
<script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
{{ .Page.Scratch.Set "mermaid" true }} {{ .Page.Scratch.Set "mermaid" true }}
{{ end }} {{ end }}
<!-- prettier-ignore-end -->
<pre class="gblog-mermaid mermaid {{ with .Get "class" }}{{ . }}{{ end }}"> <pre class="gblog-mermaid mermaid {{ with .Get "class" }}{{ . }}{{ end }}">
{{- .Inner -}} {{- .Inner -}}

479
package-lock.json generated

File diff suppressed because it is too large Load Diff