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

How to produce tikz diagram with HTML output? #474

Open
adamryczkowski opened this issue Nov 27, 2024 · 1 comment
Open

How to produce tikz diagram with HTML output? #474

adamryczkowski opened this issue Nov 27, 2024 · 1 comment

Comments

@adamryczkowski
Copy link

I use Ubuntu 24.04 with
Asciidoctor 2.0.23 with asciidoctor-diagram and
Runtime Environment (ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

I have also pdf2svg and TeXLive installed.

On my setup I can render asciidoctor-pdf tikz-demo.adoc -r asciidoctor-diagram -o tikz-demo.pdf where contents of tikz-demo.adoc are taken from https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/tikz/.

How do I generate output for HTML (with SVG)?

asciidoctor tikz-demo.adoc -r asciidoctor-diagram -o tikz-demo.html

just inlines the tikz code into the html without executing it and does not return any error.

@pepijnve
Copy link
Member

If you see the tikz code inlined then the image generation failed. You should get an error message on the console then. You could try adding on-error=abort as attribute to the tikz block. That should force asciidoctor to abort on error instead.
To get SVG output, you'll also have to add format=svg to the block.

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

No branches or pull requests

2 participants