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

PDF generation fails when an adoc contains a video reference #289

Open
andgeno opened this issue Apr 4, 2020 · 2 comments
Open

PDF generation fails when an adoc contains a video reference #289

andgeno opened this issue Apr 4, 2020 · 2 comments

Comments

@andgeno
Copy link

andgeno commented Apr 4, 2020

When an adoc file contains a video reference like this:

video::rPQoq7ThGAU[youtube]

the PDF export will fail with the following error:

image

The error message looks misleading. It definitely is the video:: tag that makes this process fail.

@andgeno
Copy link
Author

andgeno commented Apr 4, 2020

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::[]

@danyill
Copy link
Contributor

danyill commented May 10, 2020

@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::[]

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