Support

Support Options

Submit a Support Ticket

 

Help: Wiki Macros

Version 2
by Shawn Rice
Version 3
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:101]]
+
[[Resource(100)]]
18 }}}
19 +
20 Display:
21 -
[[Resource:101]]
+
[[Resource(100)]]
22
23 -
== Available Macros ==
+
{{{
24 +
[[Tag(heattransfer)]]
25 +
}}}
26
27 +
Display:
28 +
[[Tag(heattransfer)]]
29 +
30 {{{
31 -
[[Timestamp]]
+
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 -
[[Resource:(id,alias)]]
+
 
33 -
[[Tool:(id,alias)]]
+
[[FootNote]]
34 -
[[Contributor:(id,username,name)]]
+
35 -
[[Tag:tag]]
+
36 }}}
37 +
38 +
Display:
39 +
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:
40 +
41 +
[[FootNote]]
42 +
43 +
== Available Macros ==
44 +
45 +
`[[BR]]`::
46 +
Insert a line break.
47 +
`[[Span(content, attributes)]]`::
48 +
Wraps text or other elements inside a `<span>` tag.
49 +
`[[Image(filename)]]`::
50 +
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>
51 +
<li>digits and unit are interpreted as the size (ex. 120, 25%) for the image</li>
52 +
<li>right, left, top or bottom are interpreted as the alignment for the image</li>
53 +
<li>nolink means without link to image source</li>
54 +
<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>
55 +
</ul>}}}
56 +
`[[Resource(id or alias)]]`::
57 +
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>
58 +
<li>[[Resource(101)]] generates a linked title to resource #101</li>
59 +
<li>[[Resource(101, nolink)]] generates the title for resource #101</li>
60 +
</ul>}}}
61 +
`[[Contributor(id,username,name)]`::
62 +
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.
63 +
`[[Tag(tag)]]`::
64 +
This macro will generate a link to a Tag.
65 +
`[[TitleIndex(prefix)]]`::
66 +
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.
67 +
`[[FootNote(footnote text)]]`::
68 +
Add a footnote, or explicitly display collected footnotes when no args (footnote text) are given.
69 +
`[[RandomPage]]`::
70 +
Generates a link to a random page.
71 +
`[[Anchor(anchorname)]]`::
72 +
Inserts an anchor into a page.

nanoHUB.org, a resource for nanoscience and nanotechnology, is supported by the National Science Foundation and other funding agencies. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.