Re: Jekyll and asciidoctor: pygments and callouts issues
Posted by
mojavelinux on
Jul 21, 2019; 7:27am
URL: https://discuss.asciidoctor.org/Jekyll-and-asciidoctor-pygments-and-callouts-issues-tp7006p7007.html
Mayrycy,
Your Jekyll configuration is correct. However, despite that fact that you have installed the pygments.rb gem on your system (gem list), that gem is not visible to Jekyll (bundle list). You need to follow the instructions on this page to get that set up correctly:
https://jekyllrb.com/docs/ruby-101/#gemfile
Here's a project you can use as a reference:
(Only, instead of the coderay gem, you'll use pygments.rb. You should also use the latest version of jekyll-asciidoc, which is 3.0.0.beta.2).
Best,
-Dan
On Sun, Jul 21, 2019 at 12:09 AM mszmurlo [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Hi,
I've been using AsciiDoctor for some time now and it's really a great tool. I started to put all my writings together on a single site with jekyll but I have an issue with code highlighting with pygments and callouts.
* Standalone asciioctor with pygments works fine
* When the post is included in jekylls _posts directory, the file gets processed fine but there are two issues:
1. source code is not highlighted. While strating jekyll with bundle exec jekyll serve --verbose, I get the following error: asciidoctor: WARNING: optional gem 'pygments.rb' is not available (reason: cannot load 'pygments'). Functionality disabled. However when I list the gems, pugments is present:
maurycy@kali> gem list | grep py
pygments.rb (1.2.1)
rb-pygments (0.1.0)
I'm not sure hwo mandatory this is, but I also added the following configuration in _config.yaml without any success:
asciidoc: {}
asciidoctor:
attributes:
- source-highlighter=pygments
- pygments-css=style
I'm not bound to pygments. If any other highlighter is known to work better, please let me know
2. I have :icons: font in the .adoc file, and callouts get rendered fine with asciidoctor alone but really really poorly with jekyll.
Thanks in advance for any help
Mayrycy
--