szn / confluence.md

Markdown to Confluence - upload any .md files to your Confluence cloud page
23 stars 10 forks source link

Mermaid support #16

Closed Majlanky closed 2 weeks ago

Majlanky commented 6 months ago

Hi, would it be possible to add mermaid extra (processor) mentioned on https://github.com/trentm/python-markdown2/wiki/Extras ? It would be fine to make the extras configurable through command parameters.

szn commented 6 months ago

Sounds exciting – I am a big fan of Mermaid.

Sadly, the solution isn't as trivial as expected. Adding one extra parameter to markdown2 is not enough as this does not generate an image file. Additional javascript is needed to convert mermaid code into a graph (as described here https://github.com/trentm/python-markdown2/wiki/mermaid). Loading external .js is not allowed on Confluence.

I would have to extract the mermaid code, convert it into svg/png, upload it to Confluence, and link it properly. This is definitely worth the effort but I can't estimate when I'll be able to do that.