Login  Register

Re: Maven plugin and extensions

Posted by mojavelinux on May 15, 2015; 2:16am
URL: https://discuss.asciidoctor.org/Maven-plugin-and-extensions-tp3149p3212.html


On Thu, May 14, 2015 at 1:17 PM, torngat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
How are the slim templates resolved?

Slim templates are resolved relative to the templateDirs (in Gradle, template_dirs) option. You can have multiple folders. They are searched in order.

By default, Asciidoctor will look for a folder name that corresponds to the templateEngine (in Gradle, template_engine) option. If not found, it looks directly in the template dirs folder. It then looks for that file extension.

Each node has a name (i.e., context). This is the name that corresponds to the file it tries to find. For instance, a paragraph block has the name "paragraph". It then looks for the file "paragraph.html.slim" (actually, it looks for something that starts with "paragraph." and ends with ".slim"). If the node is an inline node, then it prepends "inline_" to the search path.

When you create nodes (such as in an extension), you can assign any name to the context instance variable. This is an open set. If you use an original name, it will look for a template name that's not in the standard set. That's how you introduce new templates.

 how/where can I get started to help document some of this?

There's an open issue for this. We document currently in the website. See https://github.com/asciidoctor/asciidoctor.org/issues/80 for the issue tracking this particular content. We really need to start with an outline and go from there.

Hope that helps a little.

Cheers,