asciidoctor / jekyll-asciidoc

:syringe: A Jekyll plugin that converts AsciiDoc source files in your site to HTML pages using Asciidoctor.
https://github.com/asciidoctor/jekyll-asciidoc
MIT License
311 stars 78 forks source link

Add support for rouge code highlighter #221

Open jljouannic opened 5 years ago

jljouannic commented 5 years ago

Jekyll has dropped support for Pygments in the recent 4.0 release.

The jekyll-asciidoc plugin still relies on Pygments for code styling.

As an asciidoctor-rouge gem already exists, I wonder how difficult it would be to add support for it in the plugin, so that Pygment would not be needed anymore.

mojavelinux commented 5 years ago

The jekyll-asciidoc plugin doesn't rely on Pygments for code styling. It just happens to generate the stylesheet for Pygments and copy it to the output. The same could be done for Rouge.

You can certainly use Rouge with jekyll-asciidoc today. First, set source-highlighter to rouge. Then, either set rouge-css to style or put the stylesheet in generated site yourself.

All the plugin would do is generate a copy the stylesheet for you. And we could certainly add that. You can find the logic in this file: https://github.com/asciidoctor/jekyll-asciidoc/blob/master/lib/jekyll-asciidoc/integrator.rb

mojavelinux commented 5 years ago

As an asciidoctor-rouge gem already exists

Do not use that. Asciidoctor has support for Rouge out of the box starting in 2.0.