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:
5 \[[!directive param="value" param="value"]]
7 This gets expanded before the rest of the page is processed, and can be used
8 to transform the page in various ways.
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:
15 A directive does not need to all be on one line, it can be
16 wrapped to multiple lines if you like:
18 \[[!directive foo="baldersnatch"
19 bar="supercalifragilisticexpialidocious" baz=11]]
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:
25 \[[!directive text="""
31 ikiwiki also has an older syntax for directives, which requires a
32 space in directives to distinguish them from [[wikilinks|ikiwiki/wikilink]].
33 This syntax has several disadvantages: it requires a space after directives
34 with no parameters (such as `\[[pagecount ]]`), and it prohibits spaces in
35 [[wikilinks|ikiwiki/wikilink]]. ikiwiki now provides the `!`-prefixed syntax
36 shown above as the preferred alternative. However, ikiwiki still supports
37 wikis using the older syntax, if the `prefix_directives` option is not enabled.
38 For backward compatibility with existing wikis, this option currently
39 defaults to off, so ikiwiki supports the old syntax.
41 [[!if test="enabled(listdirectives)" then="""
42 Here is a list of currently available directives in this wiki:
47 [[!if test="!enabled(listdirectives)" then="""
48 Here is a list of all directives documented in this wiki. Not all of them may be enabled:
50 [[!inline pages="ikiwiki/directive/* and !*/Discussion" archive="yes" sort=title
51 rootpage="ikiwiki/directive/contrib" postformtext="Add a new directive named:" show=0]]