diff options
author | Wang Chucheng <me@wangchucheng.com> | 2021-03-31 18:09:21 +0300 |
---|---|---|
committer | Wang Chucheng <me@wangchucheng.com> | 2021-03-31 18:09:21 +0300 |
commit | 296ed03bc593a54af0eec50c7d4e4b63b7d0ac69 (patch) | |
tree | 6ae468204a3d3f96095001578b4ee8e2d7cb5a7b /exampleSite | |
parent | 4b0bb031102826fccf891a648f44713636f33dd0 (diff) |
feat: add mermaid support
Closes #26
Diffstat (limited to 'exampleSite')
-rw-r--r-- | exampleSite/config/_default/params.yaml | 14 | ||||
-rw-r--r-- | exampleSite/content/posts/diagram-support.md | 41 |
2 files changed, 54 insertions, 1 deletions
diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index 8828b6d..77f9704 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -50,4 +50,16 @@ comment: commento: # If self-hosting, please enter the url (e.g. https://commento.example.com) here. Otherwise leave empty. - url:
\ No newline at end of file + url: + +diagram: + handler: mermaid + + # mermaid: + # # Browse https://mermaid-js.github.io/mermaid/#/Setup to see the options available. + # # You can list the key and value you want as below. + # # Because Hugo's config params are case-insensitive, you need to add `-` or `_` before the uppercase letters. + # # For example, `diagramPadding` should be written as `diagram-Padding` or other acceptable formats. + # theme: + # flowchart: + # diagram-padding: diff --git a/exampleSite/content/posts/diagram-support.md b/exampleSite/content/posts/diagram-support.md new file mode 100644 index 0000000..a93a11d --- /dev/null +++ b/exampleSite/content/posts/diagram-support.md @@ -0,0 +1,41 @@ +--- +title: Diagram Support +description: +toc: true +authors: + - example-author +tags: +categories: +series: +date: '2021-03-31T13:11:22+08:00' +lastmod: '2021-03-31T13:11:22+08:00' +featuredImage: +draft: false +--- + +Eureka supports the rendering of diagrams by using Mermaid. + +<!--more--> + + +Please include the Mermaid diagram as below. Every mermaid chart/graph/diagram definition, has to have separate `<div>` tags. + +In order to render the HTML code in the Markdown file correctly, please make sure that `markup.goldmark.renderer.unsafe` in `config.yaml` is true. + +Here is one mermaid diagram: + +<div class="mermaid"> + graph TD + A[Client] --> B[Load Balancer] + B --> C[Server1] + B --> D[Server2] +</div> + +And here is another: + +<div class="mermaid"> + graph TD + A[Client] -->|tcp_123| B(Load Balancer) + B -->|tcp_456| C[Server1] + B -->|tcp_456| D[Server2] +</div>
\ No newline at end of file |