Closed ieugen closed 4 years ago
I'll try to have a look on the weekend.
Thank you. I tried ifdef but failed. lang
is null apparently.
Hi, any update on this?
Hi,
Have you started on this?
I can't wait for this bug anymore so I'm willing to take a shot at it.
I would need some guidance so feel free to give some hints.
I'll make a PR once I have something.
I think a org.asciidoctor.gradle.jvm.MultiLanguageFunctionalSpec
would be nice for pdf as well.
I think the cause of the bug is because asciidoctor {}
block that configures the languages is part of the org.asciidoctor.jvm.convert
plugin which does HTML conversion.
I think the languages 'en', 'ro'
should be set inside the base plugin since they are a cross cutting concern.
@ysb33r : Could you please confirm? If this is the case I might be able to find a workaround by setting the options/attributes in the base / pdf plugin.
Also a bug fix in this case would be to move the locale code in the base plugin. WDYT?
It seems I fixed the problem by adding the languages to PDF plugin as well:
asciidoctorPdf {
languages 'en', 'ro'
}
So this means that this is not a bug, just a miss-understanding on my part.
I expected the languages to be inherited from the convert plugin but that did not happen since all plugins inherit from base
plugin.
I do think the language could/should be available in the base since all plugins will use something like this but I'm no expert on asciidoctor and this is just a week opinion.
Hi, Have you started on this? I can't wait for this bug anymore so I'm willing to take a shot at it. I would need some guidance so feel free to give some hints. I'll make a PR once I have something. I think a
org.asciidoctor.gradle.jvm.MultiLanguageFunctionalSpec
would be nice for pdf as well.
Have a go at it. We would like to do a 3.3.0 release at soiem stage and it would be good if this is part of it.
It seems I fixed the problem by adding the languages to PDF plugin as well:
asciidoctorPdf { languages 'en', 'ro' }
So this means that this is not a bug, just a miss-understanding on my part. I expected the languages to be inherited from the convert plugin but that did not happen since all plugins inherit from
base
plugin.I do think the language could/should be available in the base since all plugins will use something like this but I'm no expert on asciidoctor and this is just a week opinion.
From experience in using this I am also leaning over to the capability of defining it once for all tasks (as and when needed). The only way for this would be to add the functionliaty to both the asciidoctorj
and asciidoctorjs
extensions and then let the base tasks query the task extension for the values. This is nto a trivial fix, but it is not difficult either.
I have not looked at his code for a while, but it should be do-able as long as it the test refactoring is done first before actually changing the functionality.
After giving it some thought I think the solution is ok as it is right now.
Also by having it like this you get to choose a different set of languages for HTML and PDF.
If you need the same list, I think you can use a def langs = [ 'ro ', 'es', 'en' ]
and assign that.
Moving it in the base plugin in this case will make the plugins more coupled.
Inheritance is the root of all evil :).
I'm closing this.
Hi,
I have my CV written in asciidoc and I want to build it with gradle and this gradle plugin. I've noticed that the includedir value when generating PDF does not contain the
lang
attributeMy build file is here https://github.com/ieugen/ieugen.ro/blob/gradle-build/cv/build.gradle
Running the command:
./gradlew clean asciidoctor asciidoctorPdf
builds the HTML files ok but PDF's are with error: