Help: Wiki Macros

Version 3
by Shawn Rice
Version 4
by Shawn Rice

Deletions or items before changed

Additions or items after changed

1 A macro inserts dynamic HTML data in any context supporting [Help:WikiFormatting Wiki Formatting].
2
3 == Using Macros ==
4
5 Macro calls are enclosed in two ''square brackets''.
6
7 === Examples ===
8
9 {{{
10 [[Timestamp]]
11 -
}}}
+
}}}
12
13 Display:
14 [[Timestamp]]
15
16 {{{
17 [[Resource(100)]]
18 }}}
19 -
 
+
20 Display:
21 [[Resource(100)]]
22
23 {{{
24 [[Tag(heattransfer)]]
25 -
}}}
+
}}}
26
27 Display:
28 [[Tag(heattransfer)]]
29 -
 
+
30 {{{
31 To add a footnote to text you use the footnote macro. [[FootNote(Footnotes are automatically linked)]] You use the same macro but with no text to display the accumulated list of footnotes. For example:
32 -
 
+
33 -
[[FootNote]]
+
[[FootNote]]
34 -
}}}
+
}}}
35
36 Display:
37 -
To add a footnote to text you use the footnote macro. [[FootNote(Footnotes are automatically linked)]] You use the same macro but with no text to display the accumulated list of footnotes. For example:
+
To add a footnote to text you use the footnote macro. [[FootNote(Footnotes are automatically linked)]] You use the same macro but with no text to display the accumulated list of footnotes. For example:
38 -
 
+
39 -
[[FootNote]]
+
[[FootNote]]
40
41 == Available Macros ==
42 -
 
+
43 -
`[[BR]]`::
+
[[MacroList()]]
44 -
Insert a line break.
+
45 -
`[[Span(content, attributes)]]`::
+
46 -
Wraps text or other elements inside a `<span>` tag.
+
47 -
`[[Image(filename)]]`::
+
48 -
Embed an image in wiki-formatted text. The first argument is the filename of the image. The remaining arguments are optional and allow configuring the attributes and style of the rendered `<img>` element:{{{#!html<ul>
+
49 -
<li>digits and unit are interpreted as the size (ex. 120, 25%) for the image</li>
+
50 -
<li>right, left, top or bottom are interpreted as the alignment for the image</li>
+
51 -
<li>nolink means without link to image source</li>
+
52 -
<li>key=value style are interpreted as HTML attributes or CSS style indications for the image.<br />Valid keys are: align, border, width, height, alt, title, longdesc, class, id and usemap</li>
+
53 -
</ul>}}}
+
54 -
`[[Resource(id or alias)]]`::
+
55 -
This macro will insert a linked title to a resource. It can be passed wither an ID or alias. The remaining arguments are optional and allow for displaying various aspects of a resource: {{{#!html<ul>
+
56 -
<li>[[Resource(101)]] generates a linked title to resource #101</li>
+
57 -
<li>[[Resource(101, nolink)]] generates the title for resource #101</li>
+
58 -
</ul>}}}
+
59 -
`[[Contributor(id,username,name)]`::
+
60 -
This macro will generate a link to a contributor's page with the contributor's name as the link text. It accepts either the contributor's ID, username, or name. NOTE: to use a name, it must be identical to their contributor page.
+
61 -
`[[Tag(tag)]]`::
+
62 -
This macro will generate a link to a Tag.
+
63 -
`[[TitleIndex(prefix)]]`::
+
64 -
Inserts an alphabetic list of all wiki pages into the output. Accepts a prefix string as parameter: if provided, only pages with names that start with the prefix are included in the resulting list. If this parameter is omitted, all pages are listed.
+
65 -
`[[FootNote(footnote text)]]`::
+
66 -
Add a footnote, or explicitly display collected footnotes when no args (footnote text) are given.
+
67 -
`[[RandomPage]]`::
+
68 -
Generates a link to a random page.
+
69 -
`[[Anchor(anchorname)]]`::
+
70 -
Inserts an anchor into a page.
+