Help with highlightjs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with highlightjs

rotty3000
Hello All, I'm having problems getting highlightjs to work.

So far, the only highlighter I've gotten to work is coderay. However, I'd like to understand why highlightjs is not working.

In fact, I'm not even quite sure how to setup, since I haven't found instructions.
Reply | Threaded
Open this post in threaded view
|

Re: Help with highlightjs

sten_aksel
This post was updated on .
When you are using :source-highlighter: highlightjs the generated html from asciidoctor will use "protocol relative URLs" (and not include anything in front of the two forward slashes in a url/src/href attribute).

Check this: http://stackoverflow.com/questions/9646407/two-forward-slashes-in-a-url-src-href-attribute/

So how do we force asciidoctor to prefix with "http:"?
or even better:
How do we substitute "//cdnjs.cloudflare.com/ajax/libs/" with "highlight.js" to use local installation?
Reply | Threaded
Open this post in threaded view
|

Re: Help with highlightjs

sten_aksel
(Answering my own questions)
You may pass in attributes to asciidoctor - like this:

asciidoctor -a highlightjsdir=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4

or:

asciidoctor -a highlightjsdir=highlight.js
Reply | Threaded
Open this post in threaded view
|

Re: Help with highlightjs

mojavelinux
Administrator
You can also set the asset URL scheme using:

-a asset-uri-scheme=http

That controls what the URL scheme is for CDN assets.

Cheers,

-Dan

On Thu, Apr 9, 2015 at 9:41 AM, sten_aksel [via Asciidoctor :: Discussion] <[hidden email]> wrote:
(Answering my own questions)
You may pass in attributes to asciidoctor - like this:

asciidoctor -a highlightjsdir=html://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4

or:

asciidoctor -a highlightjsdir=highlight.js



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



--