Closed herberton closed 6 months ago
Hey @herberton,
Thanks for the work on this. Given the size of the diff I really need to review the change properly, but I am snowed under with work right now.
You’re welcome to fork and publish to PyPI yourself if you need this immediately.
Hi @LukeCarrier , I found a little bug but I already fix it!!!
Fixes #44
Hey @herberton, hope you're well. Sorry for the delay in getting around to this change!
I didn't want to break the convention we have of letting users specify their own embed_format
s using format strings, so in #56 I've introduced a new content
value. As the diff for this approach is smaller I'm going to close this PR in favour of the other one.
Many thanks for the idea and implementation, and I hope you're happy with this approach!
Hi @LukeCarrier ,
I work at TOTVS, from Brazil, and we use the
mkdocs-drawio-exporter
plugin in ourmkdocs
documentation (thanks a lot). We are putting this documentation to be displayed inside backstage.io and we are faced with the challenge since, for security reasons, the backstage.io techdocs plugin removes the<object/>
,<embed/>
,<iframe/>
and some other HTML tags by default (they are using DOM Purify).After studying alternatives to solve this problem, we decided to package our
mkdocs
documentation differently, embedding the SVG content inside the HTML body. So, I forked your project by enabling this new embedding format (which I calledhtml
).Basically, you need to configure
mkdocs-drawio-exporter
as follows:To enable this functionality I had to change the order of some things, so the plugin starts generating the SVGs in the
on_post_page
event and before changing the HTML body. I had to do this to be able to embed the SVG inside the HTML body.I also reorganized the source code in order to isolate the responsibilities between exporter.py and plugin.py in order to simplify usage, reducing parameter passing and promote better maintainability.
I hope to be able to activate these changes in the next version,
Herberton.