Coder Social home page Coder Social logo

Comments (13)

cwensel avatar cwensel commented on June 10, 2024

+1

from asciidoctor-gradle-plugin.

cwensel avatar cwensel commented on June 10, 2024

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.

mojavelinux avatar mojavelinux commented on June 10, 2024

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.

aalmiray avatar aalmiray commented on June 10, 2024

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

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.

cwensel avatar cwensel commented on June 10, 2024

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.

mojavelinux avatar mojavelinux commented on June 10, 2024

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.

mojavelinux avatar mojavelinux commented on June 10, 2024

I've made an ERB template for document that is compatible with v0.1.3 available:

https://github.com/asciidoctor/asciidoctor-backends/blob/asciidoctor-v0.1.3/erb/html5/document.html.erb

from asciidoctor-gradle-plugin.

aalmiray avatar aalmiray commented on June 10, 2024

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.

cwensel avatar cwensel commented on June 10, 2024

template works great, thanks.

from asciidoctor-gradle-plugin.

mojavelinux avatar mojavelinux commented on June 10, 2024

Excellent! 🍻

from asciidoctor-gradle-plugin.

aalmiray avatar aalmiray commented on June 10, 2024

Is this still an issue since version 0.5.0 ?

from asciidoctor-gradle-plugin.

mojavelinux avatar mojavelinux commented on June 10, 2024

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.

aalmiray avatar aalmiray commented on June 10, 2024

Alright, let's close this puppy.

from asciidoctor-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.