-
Notifications
You must be signed in to change notification settings - Fork 124
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
Community feedback request for Asciidoctor 5. #742
Comments
I like the idea of moving to a model-based approach. I think it'll improve the DSL and, as noted above, it's more closely aligned with the modern way of doing things in Gradle. I do wonder a bit about the terminology, however. Naming's always hard, but I find it a little counter-intuitive to be configuring the backends, themes etc – settings that are all about how the output is produced – on something that's called a source set. A source set, in my mind at least, is almost entirely about the input side of things with the output side being limited to where the output will be written and some links to the tasks that will produce that output. Perhaps this could be addressed with different terminology? Alternatively, I wonder if the source set-specific configuration of backends and themes, etc, should move to tasks that are connected" to a source set. This would be analogous to Having written the above, I'm not sure that it works when you want to have different tasks for PDF, ePub, etc. How would a user indicate that those tasks should be created if there's no setting on the "source set" to allow them to do so? I'll leave it here as hopefully the thought process is still of some use and may help to spark some other ideas… |
@wilkinsona Maybe instead of the word And maybe instead of asciidoc {
publications {
main {
sourceDir = 'src/docs/asciidoc' // This will be the default location as before
sources {
include 'toplevel.adoc', 'another.adoc', 'third.adoc'
}
formats {
pdf {
useJvmEngine() // Tell it to produce a pdf using the asciidoctorj engine
}
}
}
}
} |
|
There is a requirement to make this plugin configuration cache-compatible and also to prepare for some future Gradle features such as isolated projects and declartative gradle..
This also means that we'll only support Gradle 7.3 and later.
It gives us the chance to do some much needed restructuring and use Asciidoctorj 3.x engine.
To prepare a 5.x release of this plugin-suite I propose some radical (and breaking) changes to the DSL.
It would be great to get some feedback from the community on these.
The current DSL
A typical usage might be something like
Feedback from the community has indicated that the major issue with this is that this needs to use two different sources and that
asciidoctorPdf
needs to be modified to use the same source as theasciidoctor
task.They would prefer to have one task again and declare all of the output types in one place like it was with the 1.x & 2.x releases
With 3.x & 4.x we broke away from that becasue we did want to provide better DSLs for specific output types and we did not want to unnecessarily have asciidoctor output jars on the classpath that are not needed.
The changes for v5
Instead of customising tasks, I think we should move to a model, which are gaing momentum in the Gradle world, and that is to declare source sets and each declaration will then create the appropriate tasks.
This means that we can still have a
asciidoctor
and anasciidoctorPdf
task, but that we do all the common configuration in the source set.This will create two source sets.
By default the source directories will be
src/docs/asciidoc
andsrc/docs/asciidocMyExtra
.Output directories will be
build/docs/asciidoc
andbuild/adocs/asciidocMyExtra
.Most of the configuration that is availabe today as per https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/release_4_0_3/docs/modules/ROOT/pages/common-task-configuration.adoc will be available on each sourceset.
All the backends for output will be declared in one place.
Certain backends will only be available if another plugin is applied.
The backends also declare on which engine it should be run - JVM or JS.
Engines are made available via plugins.
I will not be possioble to run the same backend (output format) on two different engines within the same source set.
If no backends are specified, it will be assumed that it will
html5
on the JaAssuming that all the plugins have been applied, the above will create the following tasks:
asciidoctor
asciidoctorPdf
asciidoctorEpub
myExtraAsciidoctor
Example: Working with PDF
It is proposed that the
pdfThemes
extension becomes an extension onasciidoc
extension.The text was updated successfully, but these errors were encountered: