From de6c43d505c92f9b8f1db6915710d888a3c89da8 Mon Sep 17 00:00:00 2001 From: Nico Jansen Date: Tue, 14 Dec 2021 09:22:02 +0100 Subject: [PATCH] docs(readme): document mmdc with markdown output --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index f9499597..2f2e244e 100644 --- a/README.md +++ b/README.md @@ -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