Re: Using slim include in a template

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/Using-slim-include-in-a-template-tp4923p4924.html

I use includes in the Asciidoctor Bespoke converter, so you should be able to cheat off of that.

https://github.com/asciidoctor/asciidoctor-bespoke/blob/master/templates/slim/document.html.slim

If you point me to a branch, I can investigate.

(Note that 'slim/include' is automatically loaded by Asciidoctor's template converter).

By default, Slim will resolve the path relative to the current directory. However, I wanted to be able to take this further, so I added additional load paths to the Slim configuration. I still think the Reveal.js converter should follow in the footsteps and subclass the composite converter. It will open up a lot of doors and make packaging possible.

https://github.com/asciidoctor/asciidoctor-bespoke/blob/master/lib/asciidoctor-bespoke/converter.rb

Cheers,

-Dan

On Sat, Aug 27, 2016 at 9:20 PM, obilodeau [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm trying to remove template markup/code duplication in the reveal.js template and I tried to use the slim include directive: https://github.com/slim-template/slim/blob/master/doc/include.md

I wasn't able to make it work. Asciidoctor would crash with:

Failed to load AsciiDoc document - 'include_slide_section.html.slim

Should it work? How should I proceed?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Using-slim-include-in-a-template-tp4923.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



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