asciidoctor / asciidoctorj

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
http://asciidoctor.org
Apache License 2.0
625 stars 173 forks source link

Consider re-implementing the cli (asciidoctorj command) using Warbler #193

Open mojavelinux opened 10 years ago

mojavelinux commented 10 years ago

Currently, the cli in AsciidoctorJ is custom built using jcommander. I think we should look into Warbler (https://github.com/jruby/warbler) to create a simple wrapper around the Asciidoctor command-line so that we don't have to maintain a separate command-line implementation in AsciidoctorJ.

NOTE: Perhaps the JRuby Gradle plugin could provide a task for creating a jar file using warbler.

To try out warbler, just follow these steps:

$ git clone https://github.com/asciidoctor/asciidoctor
  cd asciidoctor
  bundle
  gem install warbler
  warble
  java -jar asciidoctor.jar -v

You should see output similar to:

Asciidoctor 1.5.1.dev [http://asciidoctor.org]
Runtime Environment (jruby 1.7.13 (1.9.3p392) 2014-06-24 43f133c on OpenJDK 64-Bit Server VM 1.8.0_11-b12 +indy [linux-amd64])

All we need to do is get whatever class Warbler is putting into that jar file into AsciidoctorJ and we've got it! No extra jars!!

https://github.com/jruby/warbler/blob/master/ext/JarMain.java

mojavelinux commented 9 years ago

We don't have to use Warbler specifically. We can just do whatever Warbler does to delegate to the cli class provided by the gem.

robertpanzer commented 9 months ago

I wonder how a user would register their own processors, converters etc if we don't explicitly run the code to load these extensions via the ServiceLoader anymore? Wouldn't it be painful if the writer of an extension in Java would have to write their own Ruby code to load Asciidoctor and register their Java extension?