]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive.mdwn
(no commit message)
[ikiwiki.git] / doc / ikiwiki / directive.mdwn
1 [[!meta robots="noindex, follow"]]
2 Directives are similar to a [[ikiwiki/WikiLink]] in form, except they
3 begin with `!` and may contain parameters. The general form is:
4
5         \[[!directive param="value" param="value"]]
6
7 This gets expanded before the rest of the page is processed, and can be used
8 to transform the page in various ways.
9
10 The quotes around values can be omitted if the value is a simple word.
11 Also, some directives may use parameters without values, for example:
12
13         \[[!tag foo]]
14
15 A directive does not need to all be on one line, it can be
16 wrapped to multiple lines if you like:
17         
18         \[[!directive foo="baldersnatch"
19         bar="supercalifragilisticexpialidocious" baz=11]]
20
21 Also, multiple lines of *quoted* text can be used for a value.
22 To allow quote marks inside the quoted text, delimit the block
23 of text with triple-quotes:
24
25         \[[!directive text="""
26         1. "foo"
27         2. "bar"
28         3. "baz"
29         """]]
30
31 ikiwiki also has an older syntax for directives, which requires a space in
32 directives to distinguish them from [[wikilinks|ikiwiki/wikilink]]. This
33 syntax has several disadvantages: it requires a space after directives with
34 no parameters (such as `\[[pagecount ]]`), and it prohibits spaces in
35 [[wikilinks|ikiwiki/wikilink]].  ikiwiki now provides the `!`-prefixed
36 syntax shown above as default.  However, ikiwiki still supports wikis using
37 the older syntax, if the `prefix_directives` option is disabled.
38
39 [[!if test="enabled(listdirectives)" then="""
40 Here is a list of currently available directives in this wiki:
41
42 [[!listdirectives ]]
43 """]]