-
Notifications
You must be signed in to change notification settings - Fork 6
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
Mermaid Support #165
Mermaid Support #165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for keeping protocol here as well: I added automatic theming, it will now use EDIT: of course we could always make the whole page reload when the theme changes but I don't know if that's worth it just for this |
a959f7a
to
1d24c15
Compare
Update: I changed it so that the page refreshes now when the theme changes and there is Mermaid content |
Nice approach! I am quite unable to test this as my system doesn't have a concept of Or if you know an alternative way to test if this works, let me know. (I've had a habit to rebuild the whole thing whenever I make any changes, including CSS. Should probably get better habits.) |
Close #132
Mermaid is incredibly annoying to run server-side and it seems they really don't want people to do this. So I ended up making it run client-side by symlinking the Node module into the
static/
directory. And turns out the same thing works for Katex, so I did it there as well which cleaned up our repo quite nicelyThe client-side parsing on the other hand is very easy to implement, I just followed this example and created the
class="mermaid"
containers analogously to how we parse Dot/Graphviz.One consideration might be to let people have Mermaid configuration but it seems that there is quite a bit in those configuration options that can break things so I would hold off on it until someone asks for it.