diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-10-14 23:56:26 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2021-10-15 00:01:41 -0600 |
| commit | 343e61b0b3b7aa6318cd57bba7a9eb2246847910 (patch) | |
| tree | 3863156e9aee1925f95407cf0fad013812643229 /docs/modules/api/pages | |
| parent | 397eac5568125136c4c32f875e8d4ee030d5c48f (diff) | |
remap api:load-templates.adoc to convert:templates.adoc
Diffstat (limited to 'docs/modules/api/pages')
| -rw-r--r-- | docs/modules/api/pages/load-templates.adoc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/docs/modules/api/pages/load-templates.adoc b/docs/modules/api/pages/load-templates.adoc deleted file mode 100644 index 2f9a16f1..00000000 --- a/docs/modules/api/pages/load-templates.adoc +++ /dev/null @@ -1,24 +0,0 @@ -= Load Custom Templates -:url-tilt: https://github.com/rtomayko/tilt -:url-tests: {url-org}/asciidoctor/tree/master/test - -Asciidoctor allows you to override the converter methods used to convert almost any individual AsciiDoc element. -If you provide a directory of {url-tilt}[Tilt^]-compatible templates, named in such a way that Asciidoctor can figure out which template goes with which element, Asciidoctor will use the templates in this directory instead of its built-in templates for any elements for which it finds a matching template. -It will fallback to its default templates for everything else. - -[source,ruby] ----- -puts Asciidoctor.convert '*This* is Asciidoctor.', - standalone: true, template_dir: 'templates' ----- - -The Document and Section templates should begin with `document` and `section`, respectively. -The file extension is used by Tilt to determine which view framework it will use to use to interpret the template. -For instance, if you want to write the template in ERB, you'd name these two templates `document.html.erb` and `section.html.erb`. -The first file extension, `.html`, maps to the converter and the second, `.erb` maps to the template engine. -To use Haml as the template engine, you'd name the templates `document.html.haml` and `section.html.haml`. - -Templates for block elements, like a paragraph or sidebar, are named after the block they handle. -For instance, to override the default paragraph template with an ERB template, put a file named `paragraph.html.erb` in the template directory you pass to the `Document` constructor using the `:template_dir` option. - -For more usage examples, see the {url-tests}[test suite^]. |
