asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 296 forks source link

Mermaid broken on 1.7.5 #553

Closed fpizzinicce closed 1 year ago

fpizzinicce commented 1 year ago

Tried the examples but shows this error:

Failed to generate image: Could not find the 'mmdc' executable in PATH; add it to the PATH or specify its location using the 'mmdc' document attribute

rahmanusta commented 1 year ago

Some extensions require additional tool to install such as for mermaid https://github.com/mermaid-js/mermaid-cli

fpizzinicce commented 1 year ago

I tried instaling mermaid globally but shows the same error :( It works fine on 1.7.4 though...

rahmanusta commented 1 year ago

Mermaid on v1.7.4 was experimental and had some issues.

You can install the mmdc tool locally like below

npm install @mermaid-js/mermaid-cli

and later include the path as a document attribute like below

:mmdc: ./node_modules/.bin/mmdc

[mermaid,target="mermaid-graph"]
--
graph TD
    A[Start] --> B{Is it?};
    B -- Yes --> C[OK];
    C --> D[Rethink];
    D --> B;
    B -- No ----> E[End];
--
fpizzinicce commented 1 year ago

Works!

Thanks @rahmanusta