@mermaid-js/mermaid-cli 9.1.5 → 9.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/mermaid.min.js +1 -1
- package/package.json +23 -13
- package/src/cli.js +6 -0
- package/src/index.js +411 -0
- package/index.bundle.js +0 -336
package/README.md
CHANGED
|
@@ -21,6 +21,26 @@ mmdc -i input.mmd -o output.svg
|
|
|
21
21
|
mmdc -i input.mmd -o output.png -t dark -b transparent
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
### Animating an SVG file with custom CSS
|
|
25
|
+
|
|
26
|
+
The `--cssFile` option can be used to inline some custom CSS.
|
|
27
|
+
|
|
28
|
+
Please see [./test-positive/flowchart1.css](test-positive/flowchart1.css) for an example of a CSS file that has animations.
|
|
29
|
+
|
|
30
|
+
**Warning**: If you want to override `mermaid`'s [`themeCSS`](https://mermaid-js.github.io/mermaid/#/Setup?id=theme), we recommend instead adding `{"themeCSS": "..."})` to your mermaid `--configFile`. You may also need to use [`!important`](https://developer.mozilla.org/en-US/docs/Web/CSS/important) to override mermiad's `themeCSS`.
|
|
31
|
+
|
|
32
|
+
**Warning**: Inline CSS files may be blocked by your browser, depending on the [HTTP Content-Security-Policy header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) of the website that hosts your SVG.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
mmdc --input test-positive/flowchart1.mmd --cssFile test-positive/flowchart1.css -o docs/animated-flowchart.svg
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
<details>
|
|
39
|
+
<summary>Example output: docs/animated-flowchart.svg</summary>
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
</details>
|
|
43
|
+
|
|
24
44
|
### Transform a markdown file with mermaid diagrams
|
|
25
45
|
|
|
26
46
|
```sh
|
|
@@ -43,6 +63,14 @@ graph
|
|
|
43
63
|
sequenceDiagram
|
|
44
64
|
[....]
|
|
45
65
|
```
|
|
66
|
+
|
|
67
|
+
### Mermaid with custom title/desc
|
|
68
|
+
```mermaid
|
|
69
|
+
graph
|
|
70
|
+
accTitle: My title here
|
|
71
|
+
accDescr: My description here
|
|
72
|
+
A-->B
|
|
73
|
+
```
|
|
46
74
|
~~~
|
|
47
75
|
|
|
48
76
|
Becomes:
|
|
@@ -53,6 +81,9 @@ Becomes:
|
|
|
53
81
|
|
|
54
82
|
### Some more markdown
|
|
55
83
|

|
|
84
|
+
|
|
85
|
+
### Mermaid with custom title/desc
|
|
86
|
+

|
|
56
87
|
```
|
|
57
88
|
|
|
58
89
|
### Piping from stdin
|
|
@@ -99,6 +130,20 @@ the container to generate an SVG file as follows:
|
|
|
99
130
|
docker run -it -v /path/to/diagrams:/data minlag/mermaid-cli -i /data/diagram.mmd
|
|
100
131
|
```
|
|
101
132
|
|
|
133
|
+
## Use Node.JS API
|
|
134
|
+
|
|
135
|
+
It's possible to call `mermaid-cli` via a Node.JS API.
|
|
136
|
+
Please be aware that **the NodeJS API is not covered by semver**, as `mermaid-cli` follows
|
|
137
|
+
`mermaid`'s versioning.
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
import { run } from "@mermaid-js/mermaid-cli"
|
|
141
|
+
|
|
142
|
+
await run(
|
|
143
|
+
"input.mmd", "output.svg", // {optional options},
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
102
147
|
## Install locally
|
|
103
148
|
|
|
104
149
|
Some people are [having issues](https://github.com/mermaidjs/mermaid.cli/issues/15)
|