Closed sebersole closed 3 years ago
In your task, wrap backends in outputOptions
:
outputOptions {
backends 'html5'
}
That works for us. 🙂
Thanks @programming-wolf
No worries. Did it solve your problem, @sebersole ? Then we can close this issue. 😺
I can say for sure it does not work on the asciidoctorj
extension, which is a shame since we have 4 different AsciidoctorTasks in our build and they all need this same config -
> No signature of method: documentation_34h71t8h0cewmcb9ayknku8za.asciidoctorj() is applicable for argument types: (documentation_34h71t8h0cewmcb9ayknku8za$_run_closure6) values: [documentation_34h71t8h0cewmcb9ayknku8za$_run_closure6@77b3c35f]
It "works" when applied to the task. "Works" as in it does not blow up. I read that html5 is the default backend and no idea what separateOutputDirs does, so not sure :)
Sorry, I copied that from my project, you can ignore that.
My task looks like this:
class RenderCurriculumTask extends AsciidoctorTask {
@Inject
RenderCurriculumTask(WorkerExecutor worker, String curriculumFileName, String versionDate, String language, boolean withRemarks) {
super(worker)
sourceDir = new File("./docs/")
sources {
include "index.adoc"
include "${curriculumFileName}.adoc"
}
outputDir = new File("./build/")
outputOptions {
separateOutputDirs = false
backends 'pdf', 'html5'
}
...
I'm not sure what that is in reference to ;)
You can close this though. As far as I can see, applying to each individual task works.
FWIW you could achieve the same as you do by subclassing by simply iterating all of the AsciidoctorTask instances and applying the commonality. Though maybe you subclass for other reasons...
This was me trying to show how we implemented it and got it working. 🙂
so ultimately this worked for me...
tasks.withType(AsciidoctorTask).all {
baseDirFollowsSourceDir()
outputOptions {
separateOutputDirs = false
backends 'html5'
}
}
Closing as I got it working with your help. Thanks!
I am trying to upgrade from version 1.5 of the Gradle plugin to the newer 3.x versions. So far I have tried
And I have tried both
org.asciidoctor.jvm.convert
andorg.asciidoctor.jvm.base
In none of these combinations have I been able to figure out how to specify the backend(s) I want to use. In 1.5, I had:
The updated documentation for that task (https://asciidoctor.github.io/asciidoctor-gradle-plugin/master/user-guide/#_task_configuration) makes it sound like that same configuration should work:
However, with both 3.1 and 3.3, this gives: