gregturn / asciidoctor-packt

Backend and theme to convert Asciidoctor files into Packt Publishing OpenOffice doc
http://greglturnquist.com/category/learning-spring-boot
46 stars 13 forks source link

initial commit of Asciidoctor backend #2

Closed mojavelinux closed 10 years ago

mojavelinux commented 10 years ago

Here's the very start of a packt backend for use with Asciidoctor. I choose to use the slim template languages because it's the most concise language for creating XML output.

I've just done (most of) the document template so far. This covers the [header] and [footer] parts of the AsciiDoc Python backend. The next step is to do the paragraph block, then enable call to =content in the document template. Once you have these started, the rest should come quickly.

mojavelinux commented 10 years ago

You enable the backend using:

$ asciidoctor -T slim -b packt book.adoc

Once you have the backend created, then you'll be able to use Groovy plugin to drive Asciidoctor as an alternative to using the asciidoctor command.

gregturn commented 10 years ago

Thanks! I'll see how far I can get.

mojavelinux commented 10 years ago

Excellent. If you get stuck, just let me know (ideally by posting to the list). I've done enough of these backends that they are practically second nature.

The trickiest part with slim is dealing with nested inline markup. Keep in mind that you always have the option of just using a long, interpolated Ruby string anywhere you want to. There's no rule that says that every tag must be represented in Slim's DSL hierarchy.