Skip to content

Commit

Permalink
Add info about using mermaid.js diagrams to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmanc committed Sep 5, 2022
1 parent 95256af commit 547b16c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ You can also further customize the presentation:

- `extra_css`: Additional CSS files added after the reveal [theme][]
- `highlight_style_sheet`: CSS theme for highlight.js [reveal.js/lib/css/zenburn.css](reveal.js/lib/css/zenburn.css)
- `mermaid_diagrams`: Feature toggle (defaults to `false`) for [mermaid.js](https://mermaid-js.github.io/) diagrams

### Specifying reveal options and dependencies

Expand Down Expand Up @@ -227,3 +228,36 @@ This is only displayed in the speaker notes.
[dependencies]: https://github.com/hakimel/reveal.js#dependencies
[posts]: https://jekyllrb.com/docs/posts/#creating-posts
[theme]: https://github.com/hakimel/reveal.js#theming

### SVG Diagrams

You can use [mermaid-js](https://mermaid-js.github.io/mermaid/) to create SVG diagrams.

Once you’ve enabled the feature by setting `mermaid_diagrams` to `true` in `_config.yml`, code like this:

```markdown
<mermaid>
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
D-->E
</mermaid>
```

should render like this:

```mermaid
<mermaid>
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
D-->E
</mermaid>
```

You can tweak the height of the diagram by following the closing tag with an [element attribute](https://revealjs.com/markdown/#element-attributes):
`<!-- .element: style="height: 400px;" -->`.
4 changes: 4 additions & 0 deletions _posts/0000-01-09-svg-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

You can use [mermaid-js](https://mermaid-js.github.io/mermaid/) to create SVG diagrams.

(enable the feature by setting `mermaid_diagrams` to `true` in `_config.yml`)

<!-- .element: style="font-size: 50%;" -->

<mermaid>
graph TD;
A-->B;
Expand Down

0 comments on commit 547b16c

Please sign in to comment.