lua-filters
lua-filters copied to clipboard
support for mermaidjs [enhancement] v2
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!
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.
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.
The diagram generator is now maintained at https://github.com/pandoc-ext/diagram; I've added Mermaid support there.
Thank you for the contribution!