Comments (13)
+1
from asciidoctor-gradle-plugin.
Not sure if asciidoctor supports this, but would be nice to specify an independent directory to draw docinfo.[ext]
files from in the same vein as template_dir
. co-mingling *.adoc
with docinfo.[ext]
seems counter to the core philosophies.
from asciidoctor-gradle-plugin.
Chris, this is a great idea. I overlooked it originally because I was just thinking about mimicking the behavior of AsciiDoc. But since the goal of Asciidoctor is not merely to clone AsciiDoc, but to make the most user-friendly and powerful docs toolchain we possibly can build around the (evolving) AsciiDoc syntax, then we should definitely support it.
Can you file the request to support a docinfo directory against https://github.com/asciidoctor/asciidoctor?
Keep the ideas flowing!
from asciidoctor-gradle-plugin.
At the moment the plugin only assumes a handful of options (source & output dirs), every other Asciidoctor option is handled by the options
Map that's sent verbatim to Asciidoctor, see
- https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/master/src/main/groovy/org/asciidoctor/gradle/AsciidoctorTask.groovy#L42
- https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/master/src/main/groovy/org/asciidoctor/gradle/AsciidoctorTask.groovy#L111
- https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/master/src/main/groovy/org/asciidoctor/gradle/AsciidoctorTask.groovy#L123
This means the following configuration should be valid already
asciidoctor {
outputDir = new File("$buildDir/docs")
options = [
template_dirs: ['/path/to/templates/dir']
]
}
So behavior-wise the plugin is complete however it's possible that moving some of these options one level up in visibility (like AJI does) may be a good idea. What do you think?
from asciidoctor-gradle-plugin.
OK, after a bit more fussing I'm now getting an exception that leads me to believe the option is now being recognized.. see below
but...
the option name is 'template_dir
not template_dirs
.
and for some reason the template_dir
option and the stylesdir
and imagesdir
attributes are relative to the project root, not the current sub-project root, which is counter to the gradle way. this is likely why I didn't figure this out before I think.
the exception.. will hunt this down and post to aciidoctor issues independently.
11:58:10.299 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `default_coderay_stylesheet' for Asciidoctor::HTML5::DocumentTemplate:Class
11:58:10.299 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.__singleton__(lingual-docs/src/templates/document.html.erb:36)
11:58:10.299 [ERROR] [org.gradle.BuildExceptionReporter] at org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:1735)
11:58:10.299 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.__singleton__(lingual-docs/src/templates/document.html.erb)
11:58:10.300 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.__tilt_2002(lingual-docs/src/templates/document.html.erb)
11:58:10.300 [ERROR] [org.gradle.BuildExceptionReporter] at org.jruby.RubyMethod.call(org/jruby/RubyMethod.java:122)
11:58:10.300 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.evaluate(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/tilt-1.3.4/lib/tilt/template.rb:144)
11:58:10.300 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/tilt-1.3.4/lib/tilt/template.rb:77)
11:58:10.301 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/asciidoctor-0.1.3/lib/asciidoctor/renderer.rb:100)
11:58:10.301 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/asciidoctor-0.1.3/lib/asciidoctor/document.rb:625)
11:58:10.301 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/asciidoctor-0.1.3/lib/asciidoctor.rb:842)
11:58:10.302 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render_file(jar:file:/Users/cwensel/.gradle/caches/artifacts-24/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.3/jar/5cf21b4331d737ef0f3b3f543a7e5a343c1f27ec/asciidoctor-java-integration-0.1.3.jar!/gems/asciidoctor-0.1.3/lib/asciidoctor.rb:898)
11:58:10.302 [ERROR] [org.gradle.BuildExceptionReporter] at RUBY.render_file(<script>:8)
11:58:10.302 [ERROR] [org.gradle.BuildExceptionReporter] at org.jruby.gen.InterfaceImpl1457530991.render_file(org/jruby/gen/InterfaceImpl1457530991.gen:13)
11:58:10.303 [ERROR] [org.gradle.BuildExceptionReporter] at org.asciidoctor.gradle.AsciidoctorTask.processSingleDocument(AsciidoctorTask.groovy:91)
11:58:10.303 [ERROR] [org.gradle.BuildExceptionReporter] at org.asciidoctor.gradle.AsciidoctorTask.gititdone(AsciidoctorTask.groovy:82)
11:58:10.303 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
from asciidoctor-gradle-plugin.
Chris,
template_dir
and template_dirs
are aliases. The template_dirs
option was added in the 0.1.4 dev cycle and will be generally available once 0.1.4 is released.
The base_dir
that Asciidoctor sets by default is not likely useful in the Gradle context. The root (to which imagesdir
is relative) should be established using the base_dir
option inside in the plugin...still allowing the build script to override this default if necessary. (The Maven plugin currently has the same issue).
Andres,
I think it's reasonable to put the options under the options node. The reason is that in the context of the Gradle plugin, there is a third set of configuration (configuration of the plugin itself) and using this extra node for options helps keep them all separated. In other words:
- top-level config - Gradle-specific behavior, such as the output directory
- options - Asciidoctor options
- attributes - Asciidoctor attributes
wdyt?
from asciidoctor-gradle-plugin.
I've made an ERB template for document that is compatible with v0.1.3 available:
from asciidoctor-gradle-plugin.
Dan,
That's right, which means that backend
should no longer be exposed at the top level, as it's an option beloging to Asciidoctor. The only reason to have it there was to limit the options when be began the project. If AJI allows for additional backends to be specified given somesettings so must the gradle plugin.
Deprecating AsciidoctorTask.backend in the next release, removing in the next after that should be the way to go.
from asciidoctor-gradle-plugin.
template works great, thanks.
from asciidoctor-gradle-plugin.
Excellent! 🍻
from asciidoctor-gradle-plugin.
Is this still an issue since version 0.5.0 ?
from asciidoctor-gradle-plugin.
I'm quite certain this is resolved. Based on what I saw while working on the code yesterday, it appears all options are being passed on to AJI, so there's nothing left behind.
from asciidoctor-gradle-plugin.
Alright, let's close this puppy.
from asciidoctor-gradle-plugin.
Related Issues (20)
- Custom AsciidoctorTask task needs sourceDir HOT 1
- What's the way to expose "Last updated" to current time on footer tag in adoc?
- Cannot implement plugin by using task avoidance
- JavaExecSpec.main property deprecated warning and will be removed in Gradle 9.0
- Fix GEMs integration test under Windows
- Enable slides & slides-export projects
- Enable leanpub project
- Supplying closures to asciidoctorj.docExtensions causes execution issues
- Property "inProcess" is no longer available while updating to 4.0.0 HOT 3
- Can't use custom Gem (Bad file descriptor) HOT 2
- v4.0.0 compatibility issue with Java 8 HOT 8
- Invalid description in published POM HOT 5
- 4.0.x timeouts (runs out of memory?)
- Plugin includes multiple versions of the same dependency HOT 1
- Unable to use 4.0 in precompiled script plugin HOT 6
- Allow null attributes to be passed through HOT 1
- Fails to require GEMs HOT 11
- Regression with missing task dependency for additional configurations
- Gems don't work with Gradle >= 8.7 HOT 8
- Collections are not allowed HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidoctor-gradle-plugin.