mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-24 18:56:58 +02:00
Update usage.md
This commit is contained in:
@@ -35,8 +35,8 @@ locate the graphs on the page and transform them to svg files.
|
|||||||
### Include mermaid on your web page:
|
### Include mermaid on your web page:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="mermaid.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.6.0/dist/mermaid.min.js"></script>
|
||||||
<script>mermaid.initialize({startOnLoad:true});</script>
|
<script>mermaid.initialize({startOnLoad:true});</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
Further down on your page mermaid will look for tags with `class="mermaid"`. From these tags mermaid will try to
|
Further down on your page mermaid will look for tags with `class="mermaid"`. From these tags mermaid will try to
|
||||||
@@ -47,7 +47,10 @@ read the chart definiton and replace it with the svg chart.
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
CHART DEFINITION GOES HERE
|
graph LR
|
||||||
|
A --- B
|
||||||
|
B-->C[fa:fa-ban forbidden]
|
||||||
|
B-->D(fa:fa-spinner);
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -76,12 +79,12 @@ Would end up like this:
|
|||||||
B-->C[fa:fa-ban forbidden]
|
B-->C[fa:fa-ban forbidden]
|
||||||
B-->D(fa:fa-spinner);
|
B-->D(fa:fa-spinner);
|
||||||
</div>
|
</div>
|
||||||
<script src="mermaid.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.6.0/dist/mermaid.min.js"></script>
|
||||||
<script>mermaid.initialize({startOnLoad:true});</script>
|
<script>mermaid.initialize({startOnLoad:true});</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
An id attribute is also added to mermaid tags without one. ## Simple full example:
|
## Try it out, save this code as HTML and load it.
|
||||||
|
|
||||||
### To enable click event and tags in nodes
|
### To enable click event and tags in nodes
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user