lua-filters icon indicating copy to clipboard operation
lua-filters copied to clipboard

support for mermaidjs [enhancement] v2

Open garfvl opened this issue 3 years ago • 2 comments

Mermaid

EDIT: this PR is based on #181 and adds a couple of fixes to be able to use mermaid-cli inside a container (and fix the docker tests).

To use Mermaid, you must install mermaid-cli itself. See the mermaid-cli website for more details.

This filter assumes that the mmdc command is located in the path and therefore can be used from any location. Alternatively, you can set the environment variable MERMAID or use the pandoc's meta variable mermaid_path.

Additionally, if you need to add additional parameters to the mermaid-cli command, you can use the MERMAID_OPTIONS environment variable.

Example usage from the Mermaid page:

sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
    John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!

garfvl avatar Sep 17 '22 10:09 garfvl

Just commenting to let you know that I've got this PR on my todo list; I didn't have time for a review yet.

tarleb avatar Sep 19 '22 18:09 tarleb

Just commenting to let you know that I've got this PR on my todo list; I didn't have time for a review yet.

No problem, thanks for the notification.

garfvl avatar Sep 20 '22 10:09 garfvl

The diagram generator is now maintained at https://github.com/pandoc-ext/diagram; I've added Mermaid support there.

Thank you for the contribution!

tarleb avatar Apr 16 '23 17:04 tarleb