I am trying to use custom extensions with AsciidoctorJS, but struggling to get it work. When I use AsciidoctorJ it seems that the extensions seem to be picked up with the following build.gradle.kts:
import org.gradle.kotlin.dsl.`kotlin-dsl`
import org.asciidoctor.gradle.jvm.AsciidoctorTask
//import org.asciidoctor.gradle.js.nodejs.AsciidoctorTask
import io.freefair.gradle.plugins.plantuml.PlantumlTask
plugins {
id("org.asciidoctor.jvm.convert") version "4.0.0-alpha.1"
//id("org.asciidoctor.js.convert") version "4.0.0-alpha.1"
id("io.freefair.plantuml") version "6.6.3"
}
asciidoctorj {
val extensions = file(".asciidoctor/lib").listFiles().map{ f -> f.getPath() }
println(extensions)
println(requires)
requires( extensions )
println(extensions)
println(requires)
}
I can see two extensions being found and added to requires:
Hi,
I am trying to use custom extensions with AsciidoctorJS, but struggling to get it work. When I use AsciidoctorJ it seems that the extensions seem to be picked up with the following build.gradle.kts:
I can see two extensions being found and added to
requires
:Of course, the extensions fail to load because they are Javascript and not Ruby.
If I now switch to AsciidoctorJS, I tried to use requires as well as suggested by the docs: "Additional NPM modules can be added via asciidoctorj.require.". My interpretation is that it should the same as with AsciidoctorJ, but
gives me an error. So I tried to add all extensions to the set
requires
.But for some reason this does not modify the set represented by requires:
What is the appropriate way to require extensions when using AsciidoctorJs?