This commit is contained in:
Sidharth Vinod 2022-09-05 01:33:47 +05:30
parent 98e9f5751a
commit 1f6e4a0887
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
2 changed files with 11 additions and 20 deletions

View File

@ -99,8 +99,7 @@ c. The `mermaid.initialize()` call, which dictates the appearance of diagrams an
A[Client] --> B[Load Balancer]
B --> C[Server01]
B --> D[Server02]
</pre
>
</pre>
</body>
```
@ -145,8 +144,7 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
A[Client] --> B[Load Balancer]
B --> C[Server1]
B --> D[Server2]
</pre
>
</pre>
And here is another:
<pre class="mermaid">
@ -155,8 +153,7 @@ Rendering in Mermaid is initialized by `mermaid.initialize()` call. You can plac
B(Load Balancer)
B -->|tcp_456| C[Server1]
B -->|tcp_456| D[Server2]
</pre
>
</pre>
</body>
</html>
```
@ -175,15 +172,13 @@ In this example mermaid.js is referenced in `src` as a separate JavaScript file,
A --- B
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner);
</pre
>
</pre>
<pre class="mermaid">
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server1]
B --> D[Server2]
</pre
>
</pre>
<script src="The\Path\In\Your\Package\mermaid.js"></script>
<script>
mermaid.initialize({ startOnLoad: true });

View File

@ -1,7 +1,5 @@
# Usage
**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/usage.md)
Mermaid is a JavaScript tool that makes use of a Markdown based syntax to render customizable diagrams, charts and visualizations.
Diagrams can be re-rendered/modified by modifying their descriptions.
@ -257,12 +255,11 @@ This is the renderer used for transforming the documentation from Markdown to ht
```javascript
var renderer = new marked.Renderer();
renderer.code = function (code, language) {
if (code.match(/^sequenceDiagram/) || code.match(/^graph/)) {
<pre class="mermaid">' + code + '</div>';
} else {
return '<pre><code>' + code + '</code>
return '</pre>';
}
if (code.match(/^sequenceDiagram/) || code.match(/^graph/)) {
return '<pre class="mermaid">' + code + '</pre>';
} else {
return '<pre><code>' + code + '</code></pre>';
}
};
```
@ -281,8 +278,7 @@ module.exports = (options) ->
if not hasMermaid
hasMermaid = true
html += '<script src="'+options.mermaidPath+'"></script>'
html + '<div class="mermaid">'+code+'
</pre>'
html + '<pre class="mermaid">'+code+'</pre>'
else
@defaultCode(code, language)