example

Last modified by Lucas Charpentier on 2026/10/27 10:28

Audit

Macro ID
example
Source
XS
Type
Wrapper
Classification reason

Status
Reviewed
Criteria version
15.20
XWiki version
18.8.0
Audit date
2026-10-20
Auditor
Compared macros
box menu

Sources

Where to gather the information the criteria are checked against, see Gather the sources.

SourceWhat it givesUsed forWhere
DocumentationParameters, default values and examples, including the most common exampleL2, L3, and the criteria measured with the most common exampleNot recorded yet: search extensions.xwiki.org
Source codeHow the macro declares its parameters and content: types, groups, features, advanced and hidden flags, constraints, content type, inline supportC4, C5, C7, C8, C9, C13, E4, E6https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-18.8.0/xwiki-platform-core/xwiki-platform-help/xwiki-platform-help-ui/src/main/resources/Help/Code/ExampleMacro.xml
Macro descriptorWhat the Edit Macro dialog is built from, on design.xwiki.orgD1, D2, C1 to C9, E4Descriptor, list of macros with their categories
TranslationsThe name, description and parameter names in each languageD1, D2, D4, C1l10n.xwiki.org
Uses in XWiki pagesHow XWiki itself uses the macro, a realistic example when the documentation has noneL3, C2, C3, C6, C8, C9Search the xwiki organization on GitHub
Compared macrosThe audits of the macros of the same typeL1, D3box, menu
Other sources specific to this macro
  • ExampleMacro.xml: the wiki macro, defined in the Help application, with a stylesheet for the Example and Source tabs.
  • GitHub code search of the xwiki organization for {{example : the macro is only used by the Help macro pages, like Help/Macros/Box, ToC, Tree, Chart and Notifications.
CriterionResultNotes
D1 wordingOK
D2 summaryOK
D3 categoryKOminor: the macro is only in Formatting, like box and code, while a user looking for a way to show a code sample, a snippet or the source of some wiki syntax would also look under Development, where html is. A macro can have several categories since XWiki 14.6, so example could also be in Development.
D4 quick-actionKOQuick Actions finds the macro first for "example", for the ID, and for the French name "Exemple". Of the synonyms, "sample" finds it first, but "code sample", "demo", "source code", "show code" and "snippet" give no result; "snippet" lists Code Snippet and "demo" lists Emoji and Container. The German name "Beispiel" was not searched.
L1 consistencyOKcompared with box and menu. Like menu, the content is mandatory and has no default, so the Quick Action opens the Edit Macro dialog, see I1 and I3; box has an optional content. An empty example would show nothing, so the mandatory content is by design. The macro has no parameter other than its content, which box and menu both have.
L2 doc-parametersKOthe macro has no documentation page: the Documentation status page lists it as Undocumented, and no page of the Help Application, of the documentation tree or of extensions.xwiki.org describes it, its content, nor that the content is mandatory.
L3 doc-exampleKOwith no documentation there is no example at all. The macro is only used by the Help macro pages, always as one macro call wrapped in it, like {{example}}{{info}}Information message.{{/info}}{{/example}} ; the audit used that info message call, from the Box macro help page, as the most common example.
I1 patternKOthe reference wrapper, warning, is inserted by its Quick Action without a dialog; the example Quick Action, the only entry that inserts the macro, opens the Edit Macro dialog, see I3. It follows the generic behavior of macros with a mandatory content and no dedicated Quick Action, like menu, html and comment.
I2 zero-configOKthe Edit Macro dialog cannot be submitted with the default values, since the content is mandatory and empty: it stays open, with no message, the generic behavior of the dialog. An empty example would not be a sensible result, so the mandatory content is OK. Written by hand, {{example/}} fails in view mode with "Missing macro content: this macro requires content (a body)".
I3 instantKOinserting from the Quick Actions menu with "/example" and Enter opens the Edit Macro dialog with an empty Content text area; the macro is only inserted after typing the example in wiki syntax, like {{info}}Information message.{{/info}} , and submitting.
I4 cursorOKafter submitting the dialog with a content, typed text goes inside the macro content: the example is edited in place.
I5 focusN/A
E1 wysiwygOK
E2 errorsN/Athe macro has no parameter, and its content is free wiki syntax, so there is no invalid value to test. An unknown parameter is accepted, which is generic and not recorded.
E3 nestingKOin a list item and in a table cell the macro fails in view mode with "The [example] macro is a standalone macro and it cannot be used inline", and its content cannot be edited. In a box it renders and its content stays editable, and so does a list, a table or a box inside its content.
E4 inline-supportOKthe macro does not declare inline support, and its output, a block with an Example and a Source tab, cannot be inside a sentence: the missing declaration has a technical reason. In a sentence it shows the standalone error of E3.
E5 emptyOKthe content emptied in the editor stays a visible area, 952 by 76 pixels after a triple click and Delete, or 952 by 20 pixels after selecting everything, that one click puts the cursor in. Saved empty, the page holds {{example}} and an empty line, and view mode shows no error, unlike {{example/}} , which fails.
E6 inplaceKOthe content is edited in place, rendered, in the Example tab, but the Edit Macro dialog still shows it as a wiki syntax text area, also when editing an existing example, so a nested macro like the info message appears as {{info}}Information message.{{/info}} .

Parameters

ParameterC1 clarityC2 mandatoryC3 defaultsC4 input-assistanceC5 groupsC6 orderC7 alternativesC8 advancedC9 technicalC13 constraintsNotes
$contentOKOKN/AOKN/AOKN/AN/AN/AN/A

C1: the name "Content" and the description "The example code." are OK. The content is the wiki syntax that the macro renders and also shows in its Source tab, which the description does not say, but it is what "example code" means here.

C4: a free text area in the dialog, for a content edited in place, so the text area is recorded under E6 only.

KOs and tickets

Every KO needs a ticket covering it, see Report the KOs. One ticket can cover several KOs. Known issues filed for this macro are suggested in italics: link them as existing tickets when they cover the KO.

KOCriterionExisting ticketsNew tickets
D3D3 categoryXWIKI-25018
D4D4 quick-actionXWIKI-25444
L2L2 doc-parametersXWIKI-25018XINFRA-525
L3L3 doc-exampleXWIKI-25018XINFRA-526
I1I1 patternXWIKI-25563
I3I3 instantXWIKI-25563
E3E3 nestingXWIKI-23501
E6E6 inplaceXWIKI-25018XWIKI-25443 (partial)
Success

Every KO is covered by a ticket.

Tickets

TicketOriginKOs coveredKOs partly covered
XWIKI-23501ExistingE3
XWIKI-25018ExistingD3 E6 L2 L3
XWIKI-25443NewE6
XWIKI-25444NewD4
XINFRA-525NewL2
XINFRA-526NewL3
XWIKI-25563NewI1 I3

Known issues of this macro

IssueTitleStatusCriteria
XWIKI-25018The example macro from the Help application should be internal and fixedOpenD3

68 more known issues affect every macro: see the Known issues.

Get Connected