-
Notifications
You must be signed in to change notification settings - Fork 188
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
Sourcecode highlighting with coderay or pygments not working #163
Comments
Using asciidoctor (ruby) or asciidoctor.js (javascript)? |
what's mean using asciidoctor or asciidoctor.js? like : asciidoctor -D output speaker-note.adoc? This way creates html file with source hignlight,but not in the slides. |
asciidoctor: WARNING: optional gem 'coderay' is not installed. Functionality disabled. |
The above observation is from a javascript execution with 1.0.4. |
In 1.1.0 I get:
Apparently the converter is looking in a data\stylesheets folder in my presentation project. (Same for pygments) |
@keenJoe The warning about the missing gem tells you that you need to install coderay, see my original issue description. |
I think, for simplicity, we should just explicitly document that we only support highlight.js. From Javascript it's going to be a pain to implement. From Ruby, out of the box, coderay doesn't work and pygments you need to manually change your Is highlightjs adequate for your needs? |
Very much so, especially since the reason to switch to other highlighters was mainly caused by the callouts issue. Should I write a readme PR? |
Coderay should work. You just need to install it (add it to Gemfile and run bundle), then also configure Coderay (via Asciidoctor) to add the styles inline:
I agree that highlight.js is probably going to be the best experience, minus the fact that it stumbles over callout bubbles. |
@mojavelinux highlightjs stumbles no more, see the current additions to master :) At least we should state clearly that coderay only really works with a ruby setup, not with Javascript. However, there seems to be an issue right now:
with
backtracefrom D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/coderay-1.1.2/lib/coderay/encoders/html.rb:175:in `setup' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/coderay-1.1.2/lib/coderay/encoders/encoder.rb:73:in `encode' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/coderay-1.1.2/lib/coderay/duo.rb:66:in `encode' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/substitutors.rb:1406:in `highlight_source' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/substitutors.rb:128:in `block in apply_subs' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/substitutors.rb:115:in `each' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/substitutors.rb:115:in `apply_subs' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/block.rb:118:in `content' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:2335:in `block in listing' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:2212:in `instance_eval' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:2212:in `listing' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:141:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:70:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `block in content' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `map' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `content' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:3196:in `block in section' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:2839:in `instance_eval' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:2839:in `section' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:141:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:70:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `block in content' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `map' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/abstract_block.rb:79:in `content' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/document.rb:1120:in `content' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:1100:in `block in document' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:716:in `instance_eval' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:716:in `document' from D:/Dokumente/ws/asciidoctor-reveal.js/lib/asciidoctor-revealjs/converter.rb:141:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/document.rb:1060:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1502:in `convert' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `block in convert_file' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `open' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor.rb:1575:in `convert_file' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:108:in `block in invoke!' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:102:in `each' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/gems/asciidoctor-1.5.6.1/lib/asciidoctor/cli/invoker.rb:102:in `invoke!' from D:/Dokumente/ws/asciidoctor-reveal.js/bin/asciidoctor-revealjs:18:in `' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/bin/asciidoctor-revealjs:23:in `load' from D:/Dokumente/ws/microfrontends-revealjs/.bundle/gems/ruby/2.4.0/bin/asciidoctor-revealjs:23:in `' |
Just saw that. Very nice!
That's absolutely correct. Though we have to be aware that our users are split (probably pretty evenly) between JavaScript and Ruby (which is also our Java users via AsciidoctorJ). So we're really catering to different groups and just need to funnel them accordingly.
My mistake, this should be:
(the value refers to which HTML attribute it uses, class or style. class is the default). |
I did some tests with coderay, pygments, prettify and highlightjs today. I don't have time to push them up yet but I can confirm that coderay and pygments work from a Ruby setup (w/ Gemfile changes), that highlightjs works out of the box and that we don't support prettify. I'll push the tests linking to this issue and open a new compliance issue about prettify's support. @dschulten if you want to do a README PR stating that we only officially support highlightjs for now please do so. |
Thanks for testing @obilodeau! |
doc: Clarified syntax highlighting support (fixes #163)
Even when I install coderay
or pygments
I cannot use either of
I get
or
The text was updated successfully, but these errors were encountered: