Jekyll and asciidoctor: pygments and callouts issues

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

Jekyll and asciidoctor: pygments and callouts issues

mszmurlo
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
Reply | Threaded
Open this post in threaded view
|

Re: Jekyll and asciidoctor: pygments and callouts issues

mojavelinux
Administrator
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



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Jekyll-and-asciidoctor-pygments-and-callouts-issues-tp7006.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Jekyll and asciidoctor: pygments and callouts issues

mszmurlo
Thanks for the info, Dan. Works fine.
Any idea why callouts are rendered basically and not with fonts ?

Thanks again for your time
Maurycy
Reply | Threaded
Open this post in threaded view
|

Re: Jekyll and asciidoctor: pygments and callouts issues

mojavelinux
Administrator
The Jekyll AsciiDoc plugin does not provide a stylesheet by default. It's something you need to in. That's what these sections in the README mean:

* https://github.com/asciidoctor/jekyll-asciidoc#setup

I suppose that second section deserves a mention of the callout icons (which aren't really icons, just decorated numbers). I'll make a note of it.

The quickest way to get your styles set up is to grab the styles that are provided by the example project I linked to (which is the point of the example project).

Best,

-Dan

On Sun, Jul 21, 2019 at 2:41 AM mszmurlo [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks for the info, Dan. Works fine.
Any idea why callouts are rendered basically and not with fonts ?

Thanks again for your time
Maurycy



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Jekyll-and-asciidoctor-pygments-and-callouts-issues-tp7006p7008.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux