Commit b7eda855 authored by Henk Verlinde's avatar Henk Verlinde
Browse files

feat: update mermaid shortcode

parent f7867376
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@ var config = {
  fontFamily: '"Jost", -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";',
};

/* eslint-disable no-undef */

document.addEventListener('DOMContentLoaded', () => {
  mermaid.initialize(config);

/* eslint-enable no-undef */
});
+0 −3
Original line number Diff line number Diff line
@@ -92,6 +92,3 @@ rel = "sitemap"
  [[module.mounts]]
    source = "node_modules/mermaid"
    target = "assets/js/vendor/mermaid"
  [[module.mounts]]
    source = "node_modules/mermaid"
    target = "static/js/vendor/mermaid"
+25 −8
Original line number Diff line number Diff line
@@ -15,6 +15,16 @@ toc: true

## Flow

```md
{{</* mermaid class="bg-light text-center" */>}}
graph TD
  A[Hard] -->|Text| B(Round)
  B --> C{Decision}
  C -->|One| D[Result 1]
  C -->|Two| E[Result 2]
{{</* /mermaid */>}}
```

{{< mermaid class="bg-light text-center">}}
graph TD
  A[Hard] -->|Text| B(Round)
@@ -54,14 +64,21 @@ gantt

{{< mermaid >}}
classDiagram
  classA --|> classB : Inheritance
  classC --* classD : Composition
  classE --o classF : Aggregation
  classG --> classH : Association
  classI -- classJ : Link(Solid)
  classK ..> classL : Dependency
  classM ..|> classN : Realization
  classO .. classP : Link(Dashed)
  Class01 <|-- AveryLongClass : Cool
  <<interface>> Class01
  Class09 --> C2 : Where am i?
  Class09 --* C3
  Class09 --|> Class07
  Class07 : equals()
  Class07 : Object[] elementData
  Class01 : size()
  Class01 : int chimp
  Class01 : int gorilla
  class Class10 {
    <<service>>
    int id
    size()
  }
{{< /mermaid >}}

## State
+8 −3
Original line number Diff line number Diff line
{{ if .Site.Params.options.mermaid -}}
  <div class="mermaid{{ with .Get "class" }} {{ . }}{{ end }}">
  {{- .Inner -}}
    {{ $data := replaceRE "(^\\s+```)" "" .Inner -}}
    {{ replaceRE "(```\\s+$)" "" $data -}}
  </div>
{{ else }}
  {{ errorf "Set `mermaid = true` in `./config/_default/params.toml`"}}
{{ end }}
 No newline at end of file