blueswen / mkdocs-glightbox

A MkDocs plugin supports image lightbox (zoom effect) with GLightbox.
https://blueswen.github.io/mkdocs-glightbox/
MIT License
115 stars 14 forks source link

Add support for mermaid js diagrams #22

Open robinbaeurle opened 1 year ago

robinbaeurle commented 1 year ago

Hi, Based on https://github.com/squidfunk/mkdocs-material/issues/5208.

Is it possible to add an option to support mermaid js diagrams in the same way as images are supported?

GitHub is also able to display markdown in a way that the mermaid js diagrams become zoomable: https://github.com/squidfunk/mkdocs-material/blob/master/docs/reference/diagrams.md#using-flowcharts

BR

hellowac commented 1 year ago

tks @blueswen

blueswen commented 1 year ago

Hi @robinbaeurle @hellowac ,

Since the compiled result of the Mermaid diagram is not an image, our plugins can't open it in lightbox like an image.

I spent some time investigating how GitHub implements the zoomable feature for Mermaid diagrams. They have a unique pipeline and script to add this viewer feature, as described in Include diagrams in your Markdown files with Mermaid. Regrettably, I haven't been able to identify the public package they use for the Mermaid viewer. If you know of any exceptional Mermaid viewer plugins, I would love to create another MkDocs plugin to implement this feature.

AndBondStyle commented 4 months ago

I'm using kroki.io and mkdocs-kroki-plugin and it works great together with this plugin