Help: Wiki Macros
Table of Contents
A macro inserts dynamic HTML data in any context supporting Wiki Formatting.
Using Macros
Macro calls are enclosed in two square brackets.
Examples
[[Timestamp]]
Display: 2010-03-20 16:45:38
[[Resource(100)]]
Display: Curriculum on Nanotechnology
[[Tag(heattransfer)]]
Display: heat transfer
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: [[FootNote]]
Display: To add a footnote to text you use the footnote macro. [1] You use the same macro but with no text to display the accumulated list of footnotes. For example:
Available Macros
[[Span(args)]]Wraps text or other elements inside a
<span>tag.[[Tag(args)]]This macro will generate a link to a Tag.
[[Anchor(args)]]Inserts an anchor into a page.
[[Footnote(args)]]Add a footnote, or explicitly display collected footnotes when no args (footnote text) are given.
[[Helloworld(args)]]Outputs "Hello world"
[[Div(args)]]Allows content to be wrapped in a
<div>tag. This macro must be used twice:[[Div(start)]]to indicate where to create the opening<div>tag and[[Div(end)]]to indicate where to close the resulting<div>tag. Attributes may be applied by separating name/value pairs with a comma. Example:[[Div(start, class=myclass)]][[Timestamp(args)]]Displays a time-stamp in the following format: YYYY-MM-DD HH:MM:SS
[[File(args)]]Works similar to the Image macro but, instead, generates a link to a file. The first argument is the filename.
[[Page(args)]]This macro will insert a linked title to a wiki page. It can be passed either an ID or alias.
[[Titleindex(args)]]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.
[[Randompage(args)]]Generates a link to a random page.
[[Image(args)]]Embed an image in wiki-formatted text. The first argument is the file specification. The remaining arguments are optional and allow configuring the attributes and style of the rendered
<img>element:- digits and unit are interpreted as the size (ex. 120, 25%) for the image
right,left,toporbottomare interpreted as the alignment for the imagelink=some Link...replaces the link to the image source by the one specified using Link. If no value is specified, the link is simply removed.nolinkmeans without link to image source (deprecated, uselink=)key=valuestyle are interpreted as HTML attributes or CSS style indications for the image. Valid keys are:- align, border, width, height, alt, title, longdesc, class, id and usemap
bordercan only be a number
Examples:
[[Image(photo.jpg)]]# simplest[[Image(photo.jpg, 120px)]]# with image width size[[Image(photo.jpg, right)]]# aligned by keyword[[Image(photo.jpg, nolink)]]# without link to source[[Image(photo.jpg, align=right)]]# aligned by attribute[[Image(photo.jpg, 120px, class=mypic)]]# with image width size and a CSS class
[[Resource(args)]]This macro will insert a linked title to a resource. It can be passed wither an ID or alias.
[[Recentpage(args)]]Generates a link and optional bit of text to a recently created or updated page page.
Args:
- limit - Number of articles to return. Defaults to 1
- container class - A CSS class to be applied to the wrapper
DIV
[[Contributor(args)]]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.
[[Children(args)]]Inserts an alphabetic list of all sub-pages (children) of the current page into the output. Accepts one parameter:
- depth: how deep to mine for pages. Default is one level.
Example usage:
[[Children(depth=3)]][[Macrolist(args)]]Displays a list of all installed Wiki macros, including documentation if available. Optionally, the name of a specific macro can be provided as an argument. In that case, only the documentation for that macro will be rendered.
[[Fileindex(args)]]Inserts an alphabetic list of all files and images attached to this page into the output. Accepts a prefix string as parameter: if provided, only files with names that start with the prefix are included in the resulting list. If this parameter is omitted, all files are listed.