-
Notifications
You must be signed in to change notification settings - Fork 120
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
How can I configure the gradle asciidoctor 2.0 plugin to use pygments.rb as higlighter? #326
Comments
If possible, I would advise that you consider making the switch from Pygments to Rouge. Rouge is designed to be a drop-in replacement for Pygments, and now comes integrated directly in Asciidoctor. The benefit is that it requires no additional gems or system calls. Having said that, I realize that if it's possible to continue using Pygments with the 2.0 version of the Gradle plugin, that should be documented. If it's not possible, that should be documented as well. |
We never had an example of that in the plugin before. I will investigate whether pygments work. |
The following should work plugins {
id 'org.asciidoctor.jvm.pdf' version '2.0.0'
id 'org.asciidoctor.jvm.gems' version '2.0.0'
}
repositories {
jcenter()
maven { url 'http://rubygems-proxy.torquebox.org/releases' }
}
dependencies {
asciidoctorGems 'rubygems:pygments:1.2.1'
}
asciidoctorPdf {
dependsOn asciidoctorGemsPrepare
sourceDir 'docs'
asciidoctorj {
requires 'pygments'
attributes 'source-highlighter' : 'pygments'
}
} Sometime Torquebox goes awry and then it is not possible to retrieve GEMs in a maven way when they are not in the Torquebox cache already. P.S. The reason why we never had a test for this is that it requires python 2.x to be installed. Even if we used a Docker container for the testing it will add quite a bit of time to the existing test run time. (A full build with all the tests are close to 50min atm). |
If you the option to switch to plugins {
id 'org.asciidoctor.jvm.pdf' version '2.0.0'
}
repositories {
jcenter()
}
asciidoctorPdf {
sourceDir 'docs'
asciidoctorj {
attributes 'source-highlighter' : 'rouge'
}
} |
Add example of using Pygments source highlighter (#326)
I have also added an example to the appendix section of the README. |
Sorry, unfortunately I get the following error messages:
|
That's an issue with torquebox as far as I am aware. Raised jruby/rubygems-servlets#18 |
Unfortunately, I was not able to configure pygments.rb as a highlighter with the gradle asciidoctor plugin. For a small configuration example, I would be grateful.
With direct call of asciidoctor and assignment as call parameter I use pygments for a long time for the PDF creation.
The text was updated successfully, but these errors were encountered: