Login  Register

Error using gradle-asciidoctor-plugin with pygments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Error using gradle-asciidoctor-plugin with pygments

neodevelop
Actually I'm using the gradle-asciidoctor-plugin, I had the follow configuration:

asciidoctor {
  options = [
    attributes : [ 'source-highlighter' : 'pygments' ]
  ]
}

And the error is:
Caused by: org.jruby.exceptions.RaiseException: (NameError) undefined local variable or method `doc' for #<Asciidoctor::Converter::Html5Converter:0x52f558bf>
        at RUBY.document(jar:file:/Users/neodevelop/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj/1.5.0.preview.7/946801c962a23808795becce2f6a27f44674230c/asciidoctorj-1.5.0.preview.7.jar!/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/html5.rb:84)
        at RUBY.convert(jar:file:/Users/neodevelop/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj/1.5.0.preview.7/946801c962a23808795becce2f6a27f44674230c/asciidoctorj-1.5.0.preview.7.jar!/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/converter/base.rb:26)
        at RUBY.convert(jar:file:/Users/neodevelop/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj/1.5.0.preview.7/946801c962a23808795becce2f6a27f44674230c/asciidoctorj-1.5.0.preview.7.jar!/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor/document.rb:895)
        at RUBY.convert(jar:file:/Users/neodevelop/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj/1.5.0.preview.7/946801c962a23808795becce2f6a27f44674230c/asciidoctorj-1.5.0.preview.7.jar!/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor.rb:1401)
        at RUBY.convert_file(jar:file:/Users/neodevelop/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj/1.5.0.preview.7/946801c962a23808795becce2f6a27f44674230c/asciidoctorj-1.5.0.preview.7.jar!/gems/asciidoctor-1.5.0.preview.7/lib/asciidoctor.rb:1470)
        at RUBY.convertFile(<script>:62)
        at org.jruby.gen.InterfaceImpl1738416336.convertFile(org/jruby/gen/InterfaceImpl1738416336.gen:13)
        at org.asciidoctor.gradle.AsciidoctorTask.processSingleFile(AsciidoctorTask.groovy:161)
        at org.asciidoctor.gradle.AsciidoctorTask.processSourceDir(AsciidoctorTask.groovy:146)
        at org.asciidoctor.gradle.AsciidoctorTask$_processDocumentsAndResources_closure2.doCall(AsciidoctorTask.groovy:126)
        at org.asciidoctor.gradle.AsciidoctorTask$_eachFileRecurse_closure5.doCall(AsciidoctorTask.groovy:174)
        at org.asciidoctor.gradle.AsciidoctorTask.eachFileRecurse(AsciidoctorTask.groovy:169)
        at org.asciidoctor.gradle.AsciidoctorTask.processDocumentsAndResources(AsciidoctorTask.groovy:125)
        at org.asciidoctor.gradle.AsciidoctorTask.processAsciidocSources(AsciidoctorTask.groovy:114)

I have python and pygments installed, because I'm using the asciidoctor command directly and it's working correctly. Already I have installed the pygments.rb gem.

Some ideas?

Thanks and best regards!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Error using gradle-asciidoctor-plugin with pygments

asotobu
Now I remember that there was an error in pygments but I thought it was already fixed. When you are rendering document using CLI are you using Python implementation or Ruby implementation?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Error using gradle-asciidoctor-plugin with pygments

neodevelop
I'm using the ruby implementation: 'pygments.rb'.


2014-07-26 6:51 GMT-05:00 asotobu [via Asciidoctor :: Discussion] <[hidden email]>:
Now I remember that there was an error in pygments but I thought it was already fixed. When you are rendering document using CLI are you using Python implementation or Ruby implementation?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Error-using-gradle-asciidoctor-plugin-with-pygments-tp1922p1923.html
To unsubscribe from Error using gradle-asciidoctor-plugin with pygments, click here.
NAML



--
(¯`·._.·[Jµðn]·._.·´¯)
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Error using gradle-asciidoctor-plugin with pygments

mojavelinux
Administrator
In reply to this post by asotobu
Indeed, this was a bug in one of the 1.5.0 preview releases and has been fixed since. But you'll run into another problem. As far as I understand it, you can't use Pygments in AsciidoctorJ. The reason is because Pygments uses a interprocess communication bridge that we haven't been able to get working in the JVM environment.

The best bet for right now is to use CodeRay (i.e., the "coderay" gem), which is integrated into Asciidoctor and AsciidoctorJ. CodeRay is very comparable to Pygments.

The easiest way to support Pygments in AsciidoctorJ is to switch to Rouge...which is a port of Pygments to Ruby. There's an open issue for this integration here: https://github.com/asciidoctor/asciidoctor/issues/1040

Cheers,

-Dan


On Sat, Jul 26, 2014 at 4:51 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Now I remember that there was an error in pygments but I thought it was already fixed. When you are rendering document using CLI are you using Python implementation or Ruby implementation?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Error-using-gradle-asciidoctor-plugin-with-pygments-tp1922p1923.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Error using gradle-asciidoctor-plugin with pygments

neodevelop
I had suspected something like that. I'll take a look and see if I can fix it through.

Thanks and best regards!


2014-07-28 12:37 GMT-05:00 mojavelinux [via Asciidoctor :: Discussion] <[hidden email]>:
Indeed, this was a bug in one of the 1.5.0 preview releases and has been fixed since. But you'll run into another problem. As far as I understand it, you can't use Pygments in AsciidoctorJ. The reason is because Pygments uses a interprocess communication bridge that we haven't been able to get working in the JVM environment.

The best bet for right now is to use CodeRay (i.e., the "coderay" gem), which is integrated into Asciidoctor and AsciidoctorJ. CodeRay is very comparable to Pygments.

The easiest way to support Pygments in AsciidoctorJ is to switch to Rouge...which is a port of Pygments to Ruby. There's an open issue for this integration here: https://github.com/asciidoctor/asciidoctor/issues/1040

Cheers,

-Dan


On Sat, Jul 26, 2014 at 4:51 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Now I remember that there was an error in pygments but I thought it was already fixed. When you are rendering document using CLI are you using Python implementation or Ruby implementation?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Error-using-gradle-asciidoctor-plugin-with-pygments-tp1922p1923.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Error-using-gradle-asciidoctor-plugin-with-pygments-tp1922p1925.html
To unsubscribe from Error using gradle-asciidoctor-plugin with pygments, click here.
NAML



--
(¯`·._.·[Jµðn]·._.·´¯)