Login  Register

Using slim include in a template

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Using slim include in a template

obilodeau
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?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Using slim include in a template

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


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.


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
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Using slim include in a template

jirutka
In reply to this post by obilodeau
Reveal.js Slim templates are based on HTML5 Slim templates, before major refactoring. IIRC the generated markup of generic HTML5 template and reveal.js is very similar. Thus I’d suggest to start with HTML5 Slim templates, which are already cleaned and deduplicated, and modify them for reveal.js. It’d be IMO easier way, without reinventing the wheel.