Merge branch 'contrib' of https://github.com/deining/hugo-theme-relearn into deining-contrib

This commit is contained in:
Sören Weber 2022-10-31 15:08:23 +01:00
commit 85d2a07bc6
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 7 additions and 4 deletions

View file

@ -5,7 +5,7 @@ title = "Mermaid"
The `mermaid` shortcode generates diagrams and flowcharts from text, in a similar manner as Markdown using the [Mermaid](https://mermaidjs.github.io/) library. The `mermaid` shortcode generates diagrams and flowcharts from text, in a similar manner as Markdown using the [Mermaid](https://mermaidjs.github.io/) library.
{{< mermaid >}} {{< mermaid align="center" >}}
graph LR; graph LR;
If --> Then If --> Then
Then --> Else Then --> Else
@ -33,7 +33,7 @@ To use codefence syntax you have to turn off `guessSyntax` for the `markup.highl
{{% tab name="codefence" %}} {{% tab name="codefence" %}}
````md ````md
```mermaid ```mermaid { align="center" }
graph LR; graph LR;
If --> Then If --> Then
Then --> Else Then --> Else
@ -44,7 +44,7 @@ graph LR;
{{% tab name="shortcode" %}} {{% tab name="shortcode" %}}
````go ````go
{{</* mermaid */>}} {{</* mermaid align="center" */>}}
graph LR; graph LR;
If --> Then If --> Then
Then --> Else Then --> Else
@ -58,6 +58,7 @@ graph LR;
{{ partial "shortcodes/mermaid.html" (dict {{ partial "shortcodes/mermaid.html" (dict
"context" . "context" .
"content" "graph LR;\nIf --> Then\nThen --> Else" "content" "graph LR;\nIf --> Then\nThen --> Else"
"align" "center"
)}} )}}
```` ````
@ -69,7 +70,7 @@ The generated graphs can be be panned by dragging them and zoomed by using the m
### Parameter ### Parameter
Parameter are only supported when using shortcode or partial syntax. Defaults are used when using codefence syntax. Passing parameters is supported for each available syntax (codefence, shortcode and partial).
| Name | Default | Notes | | Name | Default | Notes |
|:----------------------|:-----------------|:------------| |:----------------------|:-----------------|:------------|

View file

@ -1,4 +1,6 @@
{{ .Attributes }}
{{- partial "shortcodes/mermaid.html" (dict {{- partial "shortcodes/mermaid.html" (dict
"context" . "context" .
"content" .Inner "content" .Inner
"align" (index .Attributes "align")
) }} ) }}