Skip to content
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

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

Open
mojavelinux opened this issue Aug 27, 2014 · 2 comments
Open
Milestone

Comments

@mojavelinux
Copy link
Member

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 mojavelinux changed the title Consider a lightweight wrapper around the asciidoctor command Consider re-implementing the cli (asciidoctorj command) using Warbler Aug 27, 2014
@mojavelinux mojavelinux added this to the v1.6.0 milestone Nov 28, 2014
@mojavelinux
Copy link
Member Author

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
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants