The (:include:) command


The (:include:) command is a placeholder, which is to be replaced with content of the attached file, wnen parsing. The full syntax for the command is as follows:

(:include Attach:filename [params...]:)

Here filename is the name of the attached file and switches of the command are listed below.

Switches of the command (:include:)


The (:include:) command can take the following values:

encoding

Encoding switch indicates the encoding of the attached file to be included. Since OutWiker is incapable of recognising encodings, as, by default, it treats all files as if they were encoded in UTF-8.

If the file is encoded in text_utf8.txt the "encoding" switch may be omitted:

(:include Attach:text_utf8.txt:)

Result:
Текст в
кодировке UTF-8

For files in other encoding, the switch must be specified explicitly as follows:

(:include Attach:text_utf8.txt encoding=utf8 :)

Another example of the (:include:) command to insert a file text_1251.txt encoded in cp1251:

(:include Attach:text_1251.txt encoding=cp1251:)

Result:
Это текст
в кодировке 1251

In case the encoding is not specified, OutWiker gives an error message as in the following example:

(:include Attach:text_1251.txt:)

Result:
Encoding error in file text_1251.txt

Full list of supported encodings is extensive, it can be found on the following webpage (Python help): this page. Here is an excerpt from that list with the most commonly used encodings (note that single encoding may have multiple names):

htmlescape


The htmlescape switch forces the parser to interpret the characters <, >, , & as &lt;, &gt;, &amp;, respectively. This switch comes in handy in case the attached file contains source code.

Example of the command with the switch "htmlescape" omitted:
(:include Attach:html.txt:)

displays bolded text:
Это текст с HTML-тегами

If the switch is included
(:include Attach:html.txt htmlescape:)

it displays the HTML code:
<B>Это текст с HTML-тегами</B>

wikiparse


Wikiparse forces OutWiker to process content of the attached file with the wiki parser before rendering. This switch comes in handy in case the attached file contains wiki notation.

Example of the command with the switch "wikiparse" omitted:

(:include Attach:wiki.txt:)

displays the following non-parsed text:
'''Этот текст содержит вики-нотацию'''

If the switch is included
(:include Attach:wiki.txt wikiparse :)

it parses content as wiki-text:
Этот текст содержит вики-нотацию

If the command (:include:) is invoked with both switches "htmlescape" and "wikiparse", then OutWiker processes HTML escape characters first, and than parses the wiki notation.

It is also possible to use the tag <pre> to render listing of source code from the attached file nicely. The syntax is as follows:
<pre>
(:include Attach:filename htmlescape:)
</pre>