Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find the 'mermaid' exeutable in PATH #109

Open
klemmchr opened this issue Sep 22, 2019 · 26 comments
Open

Could not find the 'mermaid' exeutable in PATH #109

klemmchr opened this issue Sep 22, 2019 · 26 comments
Projects

Comments

@klemmchr
Copy link

I'm using the latest version of the image and wanted to include a mermaid diagram into my pdf.
If I create a new pdf using this input

[mermaid]
....
sequenceDiagram
    Alice->John: Hello John, how are you?
    loop Reply every minute
        John-->Alice: Great!
    end
....

and this command

asciidoctor-pdf -r asciidoctor-diagram [...]

the error Could not find the 'mermaid' exeutable in PATH will be printed to the final document and no diagram is generated. Instead it's displayed as source code.

@davinkevin
Copy link

I don't see mermaid-cli inside the Dockerfile declaration, so I think this image doesn't support it for now.

I will need mermaid too for a project, so I think I will create an image derivated from this one with the mermaid plugin installed (node and so on too...).

juracy added a commit to juracy/docker-asciidoctor that referenced this issue Nov 1, 2019
@juracy
Copy link
Contributor

juracy commented Nov 4, 2019

I've started to implement nodejs support on it, but I've realized mermaid-cli needs puppeteer and therefore chromium, what is a huge increase on docker image size... So I'm in doubt about change this image or create a fork... @dduportal what do you think?

@juracy
Copy link
Contributor

juracy commented Feb 5, 2020

@dduportal what do you think about increase size of container for supporting mermaid? (nodejs, puppeteer, chromium and so on?

@dduportal
Copy link
Contributor

Hello there, thank for your patience with the delays in answers, sorry for that.

Given the upcoming changes that will take place in #79 (splitting in 2 images: a really light one as "base" and a "kitchen sink" with eveytrhing inside), it could make sense.

However, let's first check the size increase: how much does it add?

@dduportal
Copy link
Contributor

As a "quick test" (but I'm not 100 % sure if it is working with any PDF example):

Adding the following code in the Dockerfile:

## Install Mermaid CLI (along with pupeeter and Chromium)
RUN apk add --no-cache npm \
  && cd /root \
  && npm install mermaid.cli

ENV PATH="${PATH}:/root/node_modules/.bin"

increased the image size almost by 2:

docker image ls | grep ascii    
asciidoctor/docker-asciidoctor   feature-mermaid           1d6c4240e561        5 seconds ago       827MB
asciidoctor/docker-asciidoctor   enhancement-alpine-3.11   fa099c425cad        19 minutes ago      428MB

I understand the need for mermaid, but it looks like these additional ~ 400 Mb will be a heavy penance for other users.

WDYT if we decline the upcoming asciidoctor/box image (that will replace the current asciidoctor/docker-asciidoctor with a "PDF exporter" variant (with chromium, pupeeter, ghostscript, etc.) ?

@juracy
Copy link
Contributor

juracy commented Feb 10, 2020

Well, let's wait for decision about asciidoctor/box, I like the idea of a big foot version (all-in-one) apart from a lighter one (suitable for most users).

@Xendar
Copy link

Xendar commented Jan 15, 2021

Any update on this one?
I'm generating asciidoc with Asciidoctor and Mermaid through Gradle and the Gradle Node plugin (to install via npm Mermaid) and as NPM is not in the image it fails (which seems expected)

@dduportal dduportal added this to TODO in Tasks via automation Mar 2, 2021
@CWempe
Copy link

CWempe commented Jul 8, 2021

Any news on this?

I tried this image:

FROM cwempe/docker-asciidoctor:ghostscript

RUN  apk -U upgrade \
     && apk add --no-cache npm\
     && cd /root \
     && npm install mermaid.cli

ENV PATH="${PATH}:/root/node_modules/.bin"

But I get the following error:

asciidoctor: ERROR: images/diagrams/Profile_und_Tags.mmd: line 0: Failed to generate image: mmdc failed: /root/node_modules/puppeteer/lib/Launcher.js:348
      reject(new Error([
             ^
Error: Failed to launch chrome! spawn /root/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome ENOENT
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
    at onClose (/root/node_modules/puppeteer/lib/Launcher.js:348:14)
    at ChildProcess.<anonymous> (/root/node_modules/puppeteer/lib/Launcher.js:339:64)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Well, let's wait for decision about asciidoctor/box, I like the idea of a big foot version (all-in-one) apart from a lighter one (suitable for most users).

I am voting for a complete "PDF exporter"-Image, too. 👍

@lfvjimisola
Copy link

@mojavelinux Any ideas on this?

@mojavelinux
Copy link
Member

I'm not the maintainer of this project.

@lfvjimisola
Copy link

lfvjimisola commented Aug 26, 2022

I'm not the maintainer of this project.

Ok. Do you have an idea of who is? @dduportal ?

@dduportal This issue is almost 3 years old and it gives a bad first experience with AsciiDoctor when you try to use mermaid and the docs states

This Docker image provides:

Asciidoctor 2.0.17

Asciidoctor Diagram 2.2.1 with ERD and Graphviz integration (supports plantuml and graphiz diagrams)

but you get

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

unless my colleague is doing something wrong. He got as far as the the chrome/puppeteer error above.

@mojavelinux
Copy link
Member

mojavelinux commented Aug 26, 2022

This issue is almost 3 years old

Given this is an open source project, the contract is that the maintainer(s) work on it when time and interest permits. If this issue is important to you, then you can investigate the problem and submit a fix for it. The age of an issue has no bearing on when an issue will be fixed. It will be fixed when someone is interested in fixing it.

I'm sorry if this problem gives a bad experience for some new users, but pinging people to demand that they fix it is not the way to go about getting it solved. Open source is fueled by people who are willing to put in the effort to solve the problem collaboratively. If you need to talk to someone about how to participate in that way, please ask in the project chat at https://chat.asciidoctor.org.

@lfvjimisola
Copy link

lfvjimisola commented Aug 26, 2022

I'm not expecting it to be fixed by maintainer(s) and I did not write that. If that is the way it was interpreted then I can only apologize.

In this particular case it seems as it should work according to the documentation but it does not. It is a bug or is the documentation wrong?

Our team are providing PRs whenever we can to various projects (e.g. currently working on a Jinja2 Template for OpenAPI JSON Spec File to AsciiDoc). But, sometimes you need help with/contact from the maintainer to know what the right way is to go e.g. build on this container or create an extended one, also if someone has an idea about the error messages. My colleague is working on it but he might need some help. I'll direct him to the chat. Thanks.

@mojavelinux
Copy link
Member

mojavelinux commented Aug 26, 2022

I think we're on the same page now. Thanks for the follow-up. In the future, just understand the @ mentioning people out of the blue is often interpreted as demanding attention. I'll keep an eye out for your colleague in that chat and do my best to provide helpful resources.

it should work according to the documentation but it does not.

I'd like to challenge this point. The documentation states: Asciidoctor Diagram 2.2.1 with ERD and Graphviz integration (supports plantuml and graphiz diagrams). I don't see "mermaid" written there. It's also no where in this file: https://github.com/asciidoctor/docker-asciidoctor/blob/main/Dockerfile. That would tell me not to expect it. Thus, it's not a bug. It's just hasn't yet been added, perhaps for good reason (or perhaps just because no one added it).

Update: If we look at the comments above, we find the reason why it has not been added:

I understand the need for mermaid, but it looks like these additional ~ 400 Mb will be a heavy penance for other users.

@dduportal
Copy link
Contributor

maintainer here: I'm going to check this in the upcoming days, but @mojavelinux summarized it very well!

@lfvjimisola if you/your colleague can spend some time on this, it is worth the effort to check the current size change of adding mermaid: it was 400mb addition layer, maybe it's better now.

@lfvjimisola also, you can already help by proposing a documentation update that would:

  • Mention that Mermaid is not supported today out of the box
  • Steps to install mermaid by providing 2 solutions:
    • Dockerfile example to extend the image with mermaid
    • A command line to run inside the current container, that would (temporarly) install mermaid in the running container

I'm late though, to implement the long due proposale I made years ago for different images: "ascidoctor" with nothing but adoc root projects, "slim" which would be the current one (minus some elements) and a "community" that would weight 1-2 Gb but would have tols such as mermaid.

@lfvelias
Copy link

Hello,

FYI
I'm the colleague of @lfvjimisola and I've now got some tips/feedback from mojavelinux in the project chat.

@lfvjimisola
Copy link

I think we're on the same page now. Thanks for the follow-up. In the future, just understand the @ mentioning people out of the blue is often interpreted as demanding attention. I'll keep an eye out for your colleague in that chat and do my best to provide helpful resources.

I'll take that with me regarding the @.

it should work according to the documentation but it does not.

I'd like to challenge this point. The documentation states: Asciidoctor Diagram 2.2.1 with ERD and Graphviz integration (supports plantuml and graphiz diagrams). I don't see "mermaid" written there. It's also no where in this file: https://github.com/asciidoctor/docker-asciidoctor/blob/main/Dockerfile. That would tell me not to expect it. Thus, it's not a bug. It's just hasn't yet been added, perhaps for good reason (or perhaps just because no one added it).

No, you're correct but AsciiDoctor Diagram includes e.g. mermaid. It's easy to interpret it as "AsciiDoctor Diagram with additional support for..." So, perhaps it could be clearer, e.g.:

Asciidoctor Diagram 2.2.1 with ERD and Graphviz integration (only supports plantuml and graphiz diagrams)

Update: If we look at the comments above, we find the reason why it has not been added:

I understand the need for mermaid, but it looks like these additional ~ 400 Mb will be a heavy penance for other users.

Yes, agreed and also the reason why I wrote "know what the right way is to go e.g. build on this container or create an extended one" above.

@lfvjimisola
Copy link

lfvjimisola commented Aug 26, 2022

@lfvjimisola if you/your colleague can spend some time on this, it is worth the effort to check the current size change of adding mermaid: it was 400mb addition layer, maybe it's better now.

He is the chat now and working on it. Thanks.

@lfvjimisola also, you can already help by proposing a documentation update that would:

  • Mention that Mermaid is not supported today out of the box

  • Steps to install mermaid by providing 2 solutions:

    • Dockerfile example to extend the image with mermaid
    • A command line to run inside the current container, that would (temporarly) install mermaid in the running container

I can file an issue/PR regarding the documentation about mermaid missing. Are there other things in AsciiDoctor Diagrams that don't work that you know of? Is it even so that only "ERD and Graphviz integration (plantuml and graphiz diagrams)" works?

I'm late though, to implement the long due proposale I made years ago for different images: "ascidoctor" with nothing but adoc root projects, "slim" which would be the current one (minus some elements) and a "community" that would weight 1-2 Gb but would have tols such as mermaid.

I think that is the way to go. asciidoctor-community would be able to build on the slim version then.

@mojavelinux
Copy link
Member

only supports plantuml and graphiz diagrams

I like the idea that the statement is very clear about what is included. Asciidoctor Diagram supports a lot of integrations, but each one requires external tools. The image provides a selection of those tools.

@mojavelinux
Copy link
Member

I can file an issue/PR regarding the documentation about mermaid missing. Are there other things in AsciiDoctor Diagrams that don't work that you know of?

I think it's best to look it from the other perspective. The README should state which external tools are included and state that if it isn't mentioned, then it isn't there.

@mojavelinux
Copy link
Member

mojavelinux commented Aug 27, 2022

I was thinking that it might also be useful for the README to show a brief example of how to extend the converter. We could even consider using this particular use case as the example. That knocks out two tasks at once. And sorry that I missed this suggestion in your earlier post:

know what the right way is to go e.g. build on this container or create an extended one

I'm in agreement, at least until the effort for an "all-in-one" container materializes.

I'm happy to help update and/or review the changes to the README. I'll watch for a PR and chime with my feedback. It's always best to send a PR early to get help, so don't worry if it isn't exactly how you want it to be yet.

@everflux
Copy link

As a regular (happy) user, I would love to have the option of a prebuild image containing mermaid support.

It seems that the idea was to land mermaid in https://hub.docker.com/r/asciidoctor/box - that image was not updated for two years :(

I can understand the reason to not include a huge dependency by default, it would be really nice to have different image flavor including mermaid to choose, though.

@dduportal
Copy link
Contributor

It seems that the idea was to land mermaid in https://hub.docker.com/r/asciidoctor/box - that image was not updated for two years :(

Thanks for your testimony!

As a maintainer, I'm seeking help to bootstrap the box project (missing time): if anyone is willing to contribute, I can help but I do not have the bandwidth to do it alone.

@barthel
Copy link
Contributor

barthel commented Mar 21, 2023

If there is still a need, I have created a multi-platform Docker image for Ascciidoctor that also has mermaid pre-installed:

github Project: https://github.com/barthel/docker-asciidoctor
Docker Hub project: https://hub.docker.com/r/uwebarthel/asciidoctor

@danmack
Copy link

danmack commented Mar 14, 2024

Pretty much agree that it's too bad we don't have an official Dockerfile that supports mermaid and agree that the 400mb increase is pretty substantial and maybe not worth it. It would be neat to use deno or bun to build just a static mmdc binary (instead of having to download the world with npm) But, deno cannot build natively on alpine because librustyv8 I think wont build (even though its a rust program using cargo). sigh. Thanks for the efforts.

@jcouton
Copy link

jcouton commented Mar 21, 2024

Hello,
You can use Kroki to generate Mermaid diagrams. It's there out of the box.

asciidoctor-revealjs -r asciidoctor-kroki index.adoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Tasks
  
TODO
Development

No branches or pull requests