Skip to content

Commit

Permalink
docs(readme): document mmdc with markdown output
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs authored and MindaugasLaganeckas committed Dec 15, 2021
1 parent 611bee8 commit de6c43d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,40 @@ mmdc -i input.mmd -o output.svg
mmdc -i input.mmd -o output.png -t dark -b transparent
```

### Transform a markdown file with mermaid diagrams

```sh
mmdc -i readme.template.md -o readme.md
```

This command transforms a markdown file itself. The mermaid-cli will find the mermaid diagrams, create SVG files from them and refer to those in the markdown output.

This:

~~~md
### Some markdown
```mermaid
graph
[....]
```

### Some more markdown
```mermaid
sequenceDiagram
[....]
```
~~~

Becomes:

```md
### Some markdown
![diagram](./readme-1.svg)

### Some more markdown
![diagram](./readme-2.svg)
```

### Piping from stdin

You can easily pipe input from stdin. This example shows how to use a heredoc to
Expand Down

0 comments on commit de6c43d

Please sign in to comment.