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.
See the docinfo file section in the user manual for details: http://asciidoctor.org/docs/user-manual/#docinfo-file

For custom HTML you need to insert at a specific location, such as a badge image, a passthrough block works best.
See the passthrough block section in the user manual for details: http://asciidoctor.org/docs/user-manual/#passthrough-blocks

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



On Thu, Oct 3, 2013 at 11:07 AM, ch007m [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

Is there a way to add a <script/> tag in the HTML page generated when using guard ? Example : ><script src="/javascripts/vendor/custom.modernizr.js"></script>
If I add this property to the xxx.adoc page (:scriptsdir: ./javascript/vendor), nothing is added.
Is there something else to do ?

Regards,

Charles


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Add-a-javascript-to-the-page-generated-guard-tp685.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | http://google.com/profiles/dan.j.allen