Re: Add a javascript to the page generated (guard)
Posted by
mojavelinux on
URL: https://discuss.asciidoctor.org/Add-a-javascript-to-the-page-generated-guard-tp685p695.html
Charles,
There are (at least) two ways to add custom HTML, in this case JavaScript, to the output document.
1. docinfo file
2. passthrough block
For things like third-party JavaScript files, a docinfo file is the best way to go.
For custom HTML you need to insert at a specific location, such as a badge image, a passthrough block works best.
The scriptsdir attribute is used for resolving built-in JavaScript files (which Asciidoctor doesn't have anyway). However, you can use this attribute anywhere in the document or the docinfo file.
Let me know if something still isn't clear.
Cheers,
-Dan