X

Geertjan's Blog

  • December 6, 2014

AsciidoctorJ and NetBeans IDE

Geertjan Wielenga
Product Manager

AsciidoctorJ is the official library for running Asciidoctor on the JVM.

Here's the start of support for AsciidoctorJ in NetBeans IDE. New AsciiDoc files can be created and you have a source editor where you can write AsciiDoc. Currently, no syntax coloring, etc, yet.

When you click the Visual togglebutton above, AsciidoctorJ is used to convert the AsciiDoc:


Right now, the conversion options are hardcoded, using CodeRay, a Ruby library for syntax highlighting. Thanks to AsciidoctorJ, no Ruby needs to be installed, since AsciidoctorJ wraps the gems. Notice the code below, which was as much fun to figure out as something really not fun and could still be wrong and looks problematic. But it works.

Asciidoctor doctor = Asciidoctor.Factory.create(Arrays.asList(
"gems/asciidoctor-1.5.0/lib",
"gems/coderay-1.1.0/lib",
"META-INF/jruby.home/lib/ruby/1.8"));
String html = doctor.convert(obj.getPrimaryFile().asText(), getInitialOptions());
htmlEditorPane.setText(html);
Need to integrate the Progress API into the above so that the progress bar runs while the conversion is taking place.

The source code of the above is here, looking forward to clones and pull requests:

https://github.com/GeertjanWielenga/AsciidoctorJ4NB

Join the discussion

Comments ( 3 )
  • guest-AsciidoctorJ Saturday, December 6, 2014

    Hi Every one,

    As a D.Sc & Ph.D ++ I wonder why I missed out on the bragging rights to AsciidoctorJ?

    or am I daft?

    Can some one please tell me what this is "AsciidoctorJ" all about?

    Thank and go well,

    SEanS


  • guest Sunday, December 7, 2014

    I've been keeping an eye on that project with the intent of doing what you just did. I'm keeping a link to this so I can get back to it after I get done reading some JavaFX books including "JavaFX Rich Client Programming on the NetBeans Platform". Actually I'm debating whether or not I should read "NetBeans Platform for Beginners" first before digging into the JavaFX one.


  • Shai Almog Saturday, January 23, 2016

    Has there been any progress on this?

    Do you guys intent to submit it to the plugin center?

    I just compiled and tried this and I really need the spell checker to get started.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.