Converter
would be left out then. That could work. I'd like to avoid requiring methods like setAsciidoctor()
or setDelegate()
to the interface. Too bad Java doesn't have traits
I am thinking off-the-cuff now as I did not look inside the implementation, but when the converter is registered via SPI, there is a Asciidoctor instance that is passed down. If you add a default method to the Converter
instance setLogger(Logger)
, a converter can choose to implement that. The during registration of the converter, you can work out something to call Converter.setLogger
at that point.
What I like about the API is that it already has LogHandler
and LogRecord
. Although that was designed for acting on logged events, it can also be applied in reverse. Alternatively what about making an instance of something available that can create LogRecord
and submit them. This instance can then be injected into a converter via @Inject
on a field or a c-tor.
News on the asciidoctor-gradle 3.x front, I have managed to create an additional plugin that integrates DeckTape to export slides to PDF/JPG/PNG. It can basically convert any HTML slide deck that DeckTape supports and that was created by an Asciidoctor task.
However, because we already have specific Reveal.js support in the GRadle plugins the integration is even more slick. It will detect the presence of the asciidoctorRevealJs
task and allow on-demand creation of asciidoctorRevealJsExport
.
asciidoctor.js
(html & docbook at least) integration into the plugin suite, I think we are near enough to release a 3.0.0-alpha.1
future in the next couple of weeks so that people can have a play.
I'm really confused about some error that popped up today.
Running AsciidoctorJ instance with classpath [
$ROOT/asciidoctor-gradle-jvm/build/libs/asciidoctor-gradle-jvm-3.0.0-alpha.1.jar,
$GRADLEHOME/wrapper/dists/gradle-4.4.1-bin/46gopw3g8i1v3zqqx4q949t2x/gradle-4.4.1/lib/groovy-all-2.4.12.jar,
$ROOT/testfixtures/offline-repo/build/repo/org.asciidoctor/asciidoctorj/2.0.0/asciidoctorj-2.0.0.jar,
$ROOT/testfixtures/offline-repo/build/repo/org.jruby/jruby-complete/9.2.7.0/jruby-complete-9.2.7.0.jar,
$ROOT/testfixtures/offline-repo/build/repo/org.asciidoctor/asciidoctorj-api/2.0.0/asciidoctorj-api-2.0.0.jar,
$ROOT/testfixtures/offline-repo/build/repo/com.beust/jcommander/1.35/jcommander-1.35.jar]
Starting process 'command '/usr/lib/jvm/java-8-oracle/bin/java''.
Working directory: $ROOT/asciidoctor-gradle-jvm-gems/build/gradleTest/external-gems/4.4.1
Command: /usr/lib/jvm/java-8-oracle/bin/java \
-Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant \
\
-cp $ROOT/asciidoctor-gradle-jvm/build/libs/asciidoctor-gradle-jvm-3.0.0-alpha.1.jar:\
$GRADLEHOME/wrapper/dists/gradle-4.4.1-bin/46gopw3g8i1v3zqqx4q949t2x/gradle-4.4.1/lib/groovy-all-2.4.12.jar:\
$ROOT/testfixtures/offline-repo/build/repo/org.asciidoctor/asciidoctorj/2.0.0/asciidoctorj-2.0.0.jar:\
$ROOT/testfixtures/offline-repo/build/repo/org.jruby/jruby-complete/9.2.7.0/jruby-complete-9.2.7.0.jar:\
$ROOT/testfixtures/offline-repo/build/repo/org.asciidoctor/asciidoctorj-api/2.0.0/asciidoctorj-api-2.0.0.jar:\
$ROOT/testfixtures/offline-repo/build/repo/com.beust/jcommander/1.35/jcommander-1.35.jar \
org.asciidoctor.gradle.remote.AsciidoctorJavaExec \
\
$ROOT/asciidoctor-gradle-jvm-gems/build/gradleTest/external-gems/4.4.1/build/tmp/asciidoctor.javaexec-data
Successfully started process 'command '/usr/lib/jvm/java-8-oracle/bin/java''
Exception in thread "main" org.jruby.exceptions.LoadError: (MissingSpecVersionError) Gem::MissingSpecVersionError
at RUBY.to_specs(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/dependency.rb:313)
at RUBY.activate_dependencies(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/specification.rb:1472)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1792)
at RUBY.activate_dependencies(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/specification.rb:1461)
at RUBY.activate(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/specification.rb:1443)
at RUBY.try_activate(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems.rb:224)
at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:123)
at RUBY.<main>(<script>:1)
This happens in a test were the asciidoctor-bibtex GEM has been added. Apparantly the issue is due to a GEM on the filesystem not being the one required, but I have no idea how to figure that out.