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

removes npm dependency by using mermaid ink service | removes referen… #265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ImJohnDoe
Copy link

Remove the dependency on npm

This issue is document as issue 167

Changes

  • removes the dependency on npm by using the mermaid ink service
  • removes references to the npm version mermaid and the related issues that is causes

Description of changes

This changes the way that mermaid.py works. Instead of doing checks to see if the npm command exists for mermaid, it makes a call to the mermaid ink service. This service takes a base64 encoded string as the mermaid code and can return either an svg or png depending on the path.

Testing

A simple test to see if this new approach works is to run the mermaid.py file and see if the mermaid charts are created in the tmp folder in the project root.

Warning

This does remove the pdf file output type.

I don't see this as an issue but someone else might.

@geekan
Copy link
Owner

geekan commented Sep 4, 2023

This is a very good submission that can lower the threshold for users to use

But when faced with third-party network requirements, I have several questions

  1. This requires a default network dependency, but this assumption may not be true in the future, such as using Llama's intranet deployment, which means it is more reasonable to make it an option?
  2. What is the payment policy for third-party services? Is it free forever? Does it promises service stability?
  3. If the third-party service is down, what is our strategy?

@alitrack
Copy link
Contributor

alitrack commented Sep 5, 2023

had better submit as a optional solution, not directly replace the original one.
feel free to have a look mine solution #289

@stellaHSR
Copy link
Collaborator

Good idea! It may be helpful when the mermaid install fails.
Can you resolve the conflicts? And provide test codes for this, please.
In addition, it will be convenient if it is configurable for installation and usage

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

Successfully merging this pull request may close these issues.

None yet

4 participants