asciidoctor-vscode
asciidoctor-vscode copied to clipboard
PDF generation fails when an adoc contains a video reference
When an adoc file contains a video reference like this:
video::rPQoq7ThGAU[youtube]
the PDF export will fail with the following error:
The error message looks misleading. It definitely is the video::
tag that makes this process fail.
Is it possible to simply exclude videos from PDFs? I tried to use ifeval
but couldn't find a way to distinguish PDF from HTML, for example.
This will evaluate true
for HTML and PDF exports:
ifeval::["{backend}" == "html5"]
video::rPQoq7ThGAU[youtube]
endif::[]
@andgeno thanks for reporting.
This is possible depending on what you are using. wkhtmltopdf which is bundled with this extension has a range of problems (and may need to be removed or replaced with asciidoctor-pdf.js, see #239 / #252). However we could set backend-pdf
for this (although I'm reluctant to put effort into maintaining wkhtmltopdf given the problems).
If you are using asciidoctor-pdf, you could do something like what is shown in the user manual:
ifndef::backend-pdf[]
<script>
//...
</script>
endif::[]
or
ifdef::backend-html5[]
<script>
//...
</script>
endif::[]