Default horizontal style for labelled lists

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Default horizontal style for labelled lists

abelsromero
Setting the custom extension is easier than I made it seem, still has some quirks, but you don't need to setup a whole separate project.
I build an example: https://github.com/abelsromero/buildSrc-asciidoctor-extension-example

This uses the `buildSrc`feature of Gradle to add the extension to the build classpath without having to set up another project.
1. Create the buildSrc directory at the root. If you have a multi-module project, you can only have one at the parent root.
2. Set up the dependencies for the build code on its own build.gradle. Here we define AsciidoctorJ 1.6.0 https://github.com/abelsromero/buildSrc-asciidoctor-extension-example/blob/master/buildSrc/build.gradle
3. Write the extension
4. This is the tricky part...To enable it, you have to use the SPI inteface, for that, define the service file https://github.com/abelsromero/buildSrc-asciidoctor-extension-example/tree/master/buildSrc/src/main/resources/META-INF/services, and the Registry https://github.com/abelsromero/buildSrc-asciidoctor-extension-example/blob/master/buildSrc/src/main/groovy/org/asciidoctor/extensions/MyExtensionRegistry.groovy.
5. Finally, tell the plugin to also use AsciidoctorJ https://github.com/abelsromero/buildSrc-asciidoctor-extension-example/blob/master/build.gradle#L11


Btw, I could circumvent the lack of a `setStyle` method, using the `setString` method of the parent object. That's not something we want to encourage, but you can use it as a workarround.

I confirmed that the setStyle method is not present in 1.6.0 either, apologies for the confusion. @gregopet, feel free to open an issue to add the method in the issues sectionhttps://github.com/asciidoctor/asciidoctorj/issues.
Reply | Threaded
Open this post in threaded view
|

Re: Default horizontal style for labelled lists

Robert.Panzer
Hi!

StructuralNode.setStyle() should be available in 1.6.0 but it's not available yet in a released version.
Therefore it's probably time for a new AsciidoctorJ 1.6.0-alpha.4 release with an updated Asciidoctor core.

The AsciidoctorJ Groovy DSL is now available in a version for AsciidoctorJ 1.6.0.
Here's an example of how to use it: https://gist.github.com/robertpanzer/7c26fea570ca5d43767076f94ef722e9
If you need the setStyle you will have to wait for a new release of 1.6.0-alpha.4.

Cheers
Robert
Reply | Threaded
Open this post in threaded view
|

Re: Default horizontal style for labelled lists

mojavelinux
Administrator

On Mon, Mar 27, 2017 at 11:36 PM, Robert.Panzer [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Therefore it's probably time for a new AsciidoctorJ 1.6.0-alpha.4 release with an updated Asciidoctor core.

Yes! Though I'd wait for Asciidoctor 1.5.6, which I'm in the process of releasing this week.

-Dan


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Default horizontal style for labelled lists

mojavelinux
Administrator
In reply to this post by Robert.Panzer

On Mon, Mar 27, 2017 at 11:36 PM, Robert.Panzer [via Asciidoctor :: Discussion] <[hidden email]> wrote:

👍


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
12