Purpose and syntax (:include:) command

Command (:include:) is designed to be inserted into a wiki page content attachments. General syntax is as follows:

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

Here filename is the name of the attached file, and params of the command shown in the next section.

Params of the command (:include:)

(:include:) command can take follow values:


encoding


Encoding parameter indicates the encoding of the included text. OutWiker can not determine file encoding, by default, it is considered that uses UTF-8.

If you want to include the file text_utf8.txt in the UTF-8, it suffices to write

(:include Attach:text_utf8.txt:)

Result:

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

For the same file encoding can be specified explicitly:

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

To insert a file text_1251.txt with encoding cp1251 command will look like this:

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

Result:

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

If you forget to specify the encoding, you get an error. 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 at this page of help in Python, we list the most commonly used encoding (one and the same code can have multiple names):


htmlescape

Parameter htmlescape tells the command that in the text read from a file, replace the characters <,> and & respectively, &lt;, &gt;, and &amp;. This is particularly useful for inserting the source program from the attached files.

For example, the command

(:include Attach:html.txt:)

displays text in bold type:

Это текст с HTML-тегами

And when you add a parameter htmlescape:

(:include Attach:html.txt htmlescape:)

will display the HTML code:

<B>Это текст с HTML-тегами</B>


wikiparse

Wikiparse parameter tells the command that file is inserted, you must first pass through the wiki parser, that is, that the attached file contains a wiki notation that must be dismantled.

For example, the command:

(:include Attach:wiki.txt:)

displays follow text:

'''Этот текст содержит вики-нотацию'''

But wish the wikiparse command:

(:include Attach:wiki.txt wikiparse :)

the wiki notation contents will be converted to HTML:

Этот текст содержит вики-нотацию



If the command (: include:) installed at the same time htmlescape and wikiparse parameters, then the first is the replacement character HTML, and then parse the wiki notation.

To insert program source code can use the following command format (:include:):

<PRE>
(:include Attach:filename htmlescape:)
</PRE>