asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
286 stars 122 forks source link

Add support for Asciidoctor skins #312

Open ysb33r opened 5 years ago

ysb33r commented 5 years ago

https://github.com/asciidoctor/asciidoctor-stylesheet-factory

As per @mojavelinux recommendation integrate with https://github.com/darshandsoni/asciidoctor-skins

mojavelinux commented 5 years ago

I really want to move people away from the stylesheet factory because it's not really maintained except for producing the default stylesheet. And that build is likely going to moved into core.

Better would be to integrate with the following themes that extend from the default stylesheet: https://github.com/darshandsoni/asciidoctor-skins

ysb33r commented 5 years ago

Conceptually a DSL like this might work:

plugins {  
  id 'org.asciidoctor.jvm.convert' version '1.2.3'
  id 'org.asciidoctor.html-skins' version '1.2.3'
}

asciidoctor {
   htmlskin {
      skin  'clear'
   }
}

(It should also be possible to use the org.asciidoctor.js.convert plugin instead of the org.asciidoctor.jvm.convert task)

A possible implementation:

jagedn commented 5 years ago

It can be a great feature

My only concern is that it's seem different to pdfThemes. Maybe a similar syntax to pdf. Something as:

htmlThemes{
   local 'myname', {
       styleDir=file('....')
       styleName='bot-orange'
  }
}
asciidoctor{
   theme 'myname'
}
mojavelinux commented 5 years ago

FYI, as of Asciidoctor PDF beta.1, it's now pdf-theme and pdf-themesdir. (We're dropping the term style in this context).

ysb33r commented 5 years ago

This part is easy

htmlThemes{
   local 'myname', {
       styleDir=file('....')
       styleName='bot-orange'
  }
}

and it will be there, but this is not

asciidoctor {
   theme 'myname'
}

The reason is that at this point in time I would prefer to inject this as a task extension when the plugin is applied. If the above is to be supported I have to build support directly into the org.asciidoctor.gradle.jvm.AsciidoctorTask and org.asciidoctor.gradle.js.nodejs.AsciidoctorTask. It will also mean that instead of a separate plugin, htmlThemes will be available whenever org.asciidoctor.js.convert org.asciidoctor.jvm.convert` plugin is applied.

Maybe the latter alternative is feasible, I have just not been convinced whether this is better.

ysb33r commented 5 years ago

FYI, as of Asciidoctor PDF beta.1, it's now pdf-theme and pdf-themesdir. (We're dropping the term style in this context).

@mojavelinux See #438