12.4 Merge Commands ↑
12.4.13 include command
This command allows you to include text from another file into the output stream being generated by the template.
An optional operand of “copy” will ensure that the include file is included without conversion; otherwise, if the input and output file extensions are different, and are capable of conversion, the input file will be converted to the output file’s format (for example, Markdown or Textile can be converted to html).
Textile conversion will be done using Notenik’s own Textile processor which is, admittedly, incomplete, and yet may still be useful for some users.
If converting from Markdown, then an optional operand of “nometa” will cause metadata lines to be skipped when generating the HTML output; otherwise, they will be included.
The filename may include variables, allowing you to tailor the included content based on one or more fields from your input data source. This is especially useful when you would like to include output from another template in the output generated by this template (effectively combining outputs from two separate templates into a single output). If an include file is not found, then it will simply be skipped and processing will continue, with a log message to note the event.
For any conversion resulting in HTML, a pseudo-tag of <toc> can be used to generate a table of contents based on following heading tags. An optional attribute of “from” can be used to specify the beginning of a range of heading levels to be included; an optional attribute of “through” or “thru” can be used to specify the end of a range of heading levels to be included. See the following example.
<toc from="h2" thru="h4" />
Next: allfields command