asciidoctor-backends repo migrated to github.com/asciidoctor

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

asciidoctor-backends repo migrated to github.com/asciidoctor

mojavelinux
Administrator
I've migrated the Haml and Slim backend templates repository for Asciidoctor from my personal space to the asciidoctor organization on GitHub.


If you're going to hack on the output that Asciidoctor generates, I strongly recommend you do it by modifying these templates. They are central to the vision of Asciidoctor because they make it very easy and familiar to customize the output and give you the full power of Ruby under the covers to get the output you want.

I still need to commit some changes to the main Asciidoctor repository (targeted for the 0.1.1 release) in order to properly support these templates...so don't despair if you can't get them working yet. Once those changes are in, here's how you'll use the template sets.

Haml templates, html5 backend (auto-selected):

 asciidoctor -T /path/to/asciidoctor-backends/haml mydoc.asciidoc

Haml templates, docbook45 backend:

 asciidoctor -T /path/to/asciidoctor-backends/haml -b docbook45 mydoc.asciidoc

Slim templates, html5 backend (auto-selected)

 asciidoctor -T /path/to/asciidoctor-backends/slim mydoc.asciidoc

Slim templates, docbook45 backend:

 asciidoctor -T /path/to/asciidoctor-backends/slim -b docbook45 mydoc.asciidoc

The sub-folder where the templates are located is selected based on the current backend. Therefore, if you created a backend for deckjs in Haml, then you would execute:

 asciidoctor -T /path/to/asciidoctor-backends/haml -b deckjs myslides.asciidoc

If you are calling Asciidoctor via the API, you pass the value of the -T parameter shown above to the :template_dir option.

NOTE: If you are implementing a custom backend, you only have to implement the templates that you want to *override*. If a template is missing, Asciidoctor will fall back to the built-in template for that backend. (Unfortunately, this doesn't yet work for backends that Asciidoctor doesn't know about, like deckjs).

If you have questions about how to use the templates, feel free to post to this list.

-Dan

--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

Loading...