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

Support SVG/HTML integration #342

Open
rmannibucau opened this issue Feb 23, 2021 · 7 comments
Open

Support SVG/HTML integration #342

rmannibucau opened this issue Feb 23, 2021 · 7 comments

Comments

@rmannibucau
Copy link

Hi,

It is possible to do svg image using plantUML (or some others) but it is integrated as an + base64 encoding. This makes the usage of SVG pretty impossible to add JS event handler on the SVG (which is one of the key facet of using SVG with vector one).
Would be great to support to inject the SVG in the dom instead of relying on the encoding hack.

@pepijnve
Copy link
Member

This is controlled by the svg-type attribute (or diagram-svg-type at the document level). If not specified you'll get whatever default value Asciidoctor decides to apply. Note that the base64 encoding is not a hack, but a means to make the generated HTML self contained. See https://docs.asciidoctor.org/asciidoc/latest/macros/image-svg/ for more details.

@rmannibucau
Copy link
Author

rmannibucau commented Feb 23, 2021

@pepijnve hmm, embedding the svg is self contained too so still sounds like the default for svg should change, no?

Edit: confirming it works with [plantuml, generated/xxx.svg, svg, role="myclass",opts=inline]

@pepijnve
Copy link
Member

That's something Asciidoctor core does, not the diagram extension. The extension generates a file on disk and passes the path to that file on to Asciidoctor core.

@rmannibucau
Copy link
Author

@pepijnve I know but it is something I'd like to not be (ie when embedded the image is not even dumped physically)

@pepijnve
Copy link
Member

BTW you should be able to get the behaviour you want by adding :diagram-svg-type: inline to the attribute section of your file.

@pepijnve
Copy link
Member

I know but it is something I'd like to not be (ie when embedded the image is not even dumped physically)

That's simply not possible today I'm afraid and I'm not inclined to add support for that. The extension uses those files on disk to avoid needlessly rerendering unchanged images for instance.

@rmannibucau
Copy link
Author

Ok I see, let's hope it is possible someday since temp images are very bothering in most editors and it is not alway easy to control them with imagesdir or equivalent.
Thanks for the inline tip btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants