[fixed] [or, worked around at least] syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

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

[fixed] [or, worked around at least] syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

hjwp
This post was updated on .
Hi all,

Prompted by my publishers, I'm making the switch from asciidoc to asciidoctor.  I've just tried rendering my book locally, and I have to say the default styles look really good!

One thing that doesn't seem to be working is the syntax highlighting of code listings.  Any ideas why?

screenshot

The listing definitely has the <code class=language-python> markup applied, but I can't see anything that would match that in the embedded stylesheet.

I'm using the command-line tool I got from "apt-get install asciidoctor".  Have also tried manually setting "asciidoctor -a source-highligher=pygments,pygments-css=class"

Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

hjwp
Switched to the gem installed version, and then installed

    gem install pygments.rb

And it worked, if I used "-a source-highlighter=pygments", or added a ":source-highlighter:pygments" directive to the main doc.

Coderay also works.

Suggestions:

1/ see if you can get coderay or pygments bundled into the debian distro version,

2/ make it clear in the docs that you have to explicitly set the source-highlighter attribute for it to work?

Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

mojavelinux
Administrator

On Sun, Mar 6, 2016 at 12:04 PM, hjwp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
1/ see if you can get coderay or pygments bundled into the debian distro version,

This should do the trick:

$ sudo apt-get install coderay

On Fedora, you'd use:

$ sudo dnf install rubygem-coderay

It's very unlikely that pygments.rb will get packaged because it violates packaging rules and is losing support from GitHub. That's why we're turning our eye towards rouge for the future.
 

2/ make it clear in the docs that you have to explicitly set the source-highlighter attribute for it to work?

http://asciidoctor.org/docs/user-manual/#source-code-blocks

-Dan

--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

hjwp
oops, sorry i missed that!

how about adding the suggestion to install coderay in the general "how to install asciidoc" section?  almost everyone is using it for things that involve code right?  (maybe i'm wrong).

thanks for replying!
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

mojavelinux
Administrator
I think this is appropriate entry for the "next steps" section.


Something like:

"If you are writing software documentation, you'll probably want to install a source highlighter, or learn about how to enable libraries that work on the client side. See ..."

Feel free to open an issue at https://github.com/asciidoctor/asciidoctor.org/issues and send a PR.

(One of the problems we have right now in general is that there are too many entry points. We're working to resolve that by consolidating pages).

-Dan

On Sun, Mar 6, 2016 at 12:22 PM, hjwp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
oops, sorry i missed that!

how about adding the suggestion to install coderay in the general "how to install asciidoc" section?  almost everyone is using it for things that involve code right?  (maybe i'm wrong).

thanks for replying!


To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: syntax highlighting (pygments/coderay) not working in vanilla apt-get install?

hjwp
here ya go!  https://github.com/asciidoctor/asciidoctor.org/pull/536

not sure you'll be able to merge it as-is, but hopefully a placeholder to start from