Highlight Code in a Page
Last modified by Vincent Massol on 2026/10/20 16:30
Content
Steps
Display a code snippet with syntax highlighting in a wiki page, using the "prism" macro.
- Edit the page and insert the "Prism" macro where the code goes.
- Paste the code in "Content", enter its language identifier in "Language" (for example java), optionally select "Linenumbers" in "Layout", and click "Submit".

In the wiki editor, write the macro on its own lines instead:
{{prism language="java" layout="linenumbers"}} @Component @Named("prism") @Singleton public class PrismMacro extends AbstractMacro<PrismMacroParameters> { } {{/prism}} - Click "Save & View". The code is displayed highlighted, with line numbers when you selected them.

FAQ
Which language identifiers can I use?
See the language parameter of the "prism" macro.
How do I highlight code inside a sentence?
Write the macro on the same line as the surrounding text: see the inline mode of the "prism" macro.