Highlighting source code for reveal.js backend

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

Highlighting source code for reveal.js backend

chalda
Hi,

I have troubles with getting highlighted ource code generated by reveal.js backend templates. I'm a new in world of Asciidoctor so I've started with documentation here: http://asciidoctor.org/docs/install-and-use-revealjs-backend/ alternatively https://github.com/asciidoctor/asciidoctor-reveal.js/.

Btw. those two documents are not in sync which gave me a lot of troubles to start with - I mean there is no information about trouble with slim gem at the web page. Plus I've need to dig github issues to find out that reveal.js is currently not supported. Would be possible to enhance the doc to avoid such trouble for beginners?

Back to my main question. From doc it seems that highlight.js is available by default but it's not true. It does not work till you specify
:source-highlighter: highlight.js
 in your adoc file. Could be possible to let the highlighting being enabled by default?

My another doubt is from note
Currently revealjs uses a rather old version of highlight.js that does not handle callouts correctly. To fix this download a current version of highlight.js and copy it to reveal.js/plugin/highlight/highlight.js.
What I can see the reveal.js packs the highlight.js to one package and adds there some function with special functionality. I do not understand how I can easily upgrade the version of the highlight.js. I've tried to find some clue at discussion about reveal.js and I was not succesfull either.

The other thing is that I'm do not understand the way how to switch from highlight.js to coderay. When I use
:source-highlighter: coderay
 then nothing happened. Do I  need to add coderay library to the project?

Thanks for your time and help
Ondra
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting source code for reveal.js backend

mojavelinux
Administrator
Ondra,

The reveal.js backend is still being developed and we're working at the moment on getting it into better shape. We'll also ensure the docs are updated. I realize there is currently a synchronization issue between the documents. That's a bug / deficiency we need to fix.

You can enable the source highlighter using:

:source-highlighter: highlightjs

This is the same in the HTML5 output and the reveal.js output (we've aligned the two recently).

In order to switch to CodeRay, you need to install the coderay gem:

 $ gem install coderay

Then you should be able to use it with reveal.js. Keep in mind that reveal.js has mostly been tested with highlight.js, so I'm unsure if the coderay highlighting will look as good (we'll eventually get it right).

Right now there's no support in the reveal.js backend to use a different version of highlight.js. I'll file an issue to get that addressed.


Cheers,

-Dan

On Mon, Feb 2, 2015 at 8:37 AM, chalda [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I have troubles with getting highlighted ource code generated by reveal.js backend templates. I'm a new in world of Asciidoctor so I've started with documentation here: http://asciidoctor.org/docs/install-and-use-revealjs-backend/ alternatively https://github.com/asciidoctor/asciidoctor-reveal.js/.

Btw. those two documents are not in sync which gave me a lot of troubles to start with - I mean there is no information about trouble with slim gem at the web page. Plus I've need to dig github issues to find out that reveal.js is currently not supported. Would be possible to enhance the doc to avoid such trouble for beginners?

Back to my main question. From doc it seems that highlight.js is available by default but it's not true. It does not work till you specify
:source-highlighter: highlight.js
 in your adoc file. Could be possible to let the highlighting being enabled by default?

My another doubt is from note
Currently revealjs uses a rather old version of highlight.js that does not handle callouts correctly. To fix this download a current version of highlight.js and copy it to reveal.js/plugin/highlight/highlight.js.
What I can see the reveal.js packs the highlight.js to one package and adds there some function with special functionality. I do not understand how I can easily upgrade the version of the highlight.js. I've tried to find some clue at discussion about reveal.js and I was not succesfull either.

The other thing is that I'm do not understand the way how to switch from highlight.js to coderay. When I use
:source-highlighter: coderay
 then nothing happened. Do I  need to add coderay library to the project?

Thanks for your time and help
Ondra


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Highlighting-source-code-for-reveal-js-backend-tp2750.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--