Using a macro in content
To use a macro, you enclose the name of the macro in a pair of double-braces ({{ }}) along with its parameters, if any:
{{macroname(parameter-list)}}
A few notes about macro calls:
- Macro names are case-sensitive, but some attempt is made to correct for common capitalization errors; you may use all lowercase even if the macro name uses caps within it, and you may capitalize a macro whose name normally starts with a lower-case letter.
- Parameters are separated by commas.
- If there are no parameters, you may leave out the parentheses entirely. For example, the macros
{{APIRef()}}and{{APIRef}}are identical. - Numeric parameters can be written with or without quotes. However, version numbers with multiple decimals need to be in quotes.
Macros can be as simple as just inserting a larger block of text or swapping in contents from another part of MDN, or as complex as building an entire index of content by searching through parts of the site, styling the output, and adding links.
See also
- Commonly used macros
- Link macros
- Sidebar macros
- Feature status macros
- Other macros (infrequently used or deprecated macros)