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

Add mermaid diagrams support through javascript #389

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nikolavp
Copy link

@nikolavp nikolavp commented Jul 9, 2024

This is the best option that I could find for this. Another way would be to shellout to the mermaid-cli but that seems too heavyweight and needs yet another cli to be installed on the machine. Where the pure javascript library is just portable.

What this does is that it reverses the highlighting done github API and then it runs the mermaid javascript library on top of the pre tags that are created.

The only downside that I can see is that there is now a dependency on the mermaid javascript library in the template. There might be ways to get around this by loading the file dynamically but that seems far too complex for my taste.

This should hopefully fix #355

nikolavp added 2 commits July 10, 2024 00:10
This is the best option that I could find for this. Another way would be
to shellout to the `mermaid-cli` but that seems too heavyweight and needs
yet another cli to be installed on the machine. Where the pure
javascript library is just portable.

What this does is that it reverses the highlighting done github API and
then it runs the mermaid javascript library on top of the pre tags that
are created.

The only downside that I can see is that there is now a dependency on
the mermaid javascript library in the template. There might be ways to
get around this by loading the file dynamically but that seems far too
complex for my taste.
@erik-nilcoast
Copy link

I just stumbled on this. I think I'll use your branch :)

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.

Feature request: mermaid diagram rendering
2 participants