Smart Code Syntax Highlighter - User Guide
Display readable, syntax-highlighted code in Confluence with configurable languages and themes, optional collapsible blocks, an editor minimap, code copying, and a fullscreen reader.
Quick Start
Edit a Confluence page. Type
/and search for Code Syntax Highlighter, then select the macro.Paste or type your code in the configuration editor.
Choose Language and Theme in the top toolbar. The editor previews your selection.
Optionally enable Collapsible and enter a Collapsed title. Enable Minimap if you want a code overview while editing.
Click Save. Wait for the updated macro preview to appear in the page editor, then publish or update the Confluence page.
To change an existing block, edit the Confluence page, select the macro, and choose its Edit action. Use Cancel to close the configuration without applying your changes.
Interface Overview
Top Toolbar
The app name is on the left. Configuration controls and help icons are grouped on the right in the following order. On narrower screens, controls can wrap onto additional lines.
Collapsible: allow readers to expand and collapse the whole block. Enabled blocks start collapsed; disabled blocks stay expanded.
Minimap: show or hide the editor overview on the right. This is an editing aid and is not shown in the published page or fullscreen reader.
Language: searchable list of 135 language options in the current interface.
Theme: searchable list of 46 built-in code color themes in the current interface.
Format: format supported languages. A vertical divider separates Format from the help icons.
Documentation (book icon): open this user guide. Support (question-mark icon): open the support portal.
Collapsed Title
When Collapsible is enabled, a separate Collapsed title row appears below the toolbar. Enter a short description, such as “User Login API (Express + JWT)”. The field has a 60-character limit and a live counter. Leave it blank to use Code Block.
The title remains in the block header when the code is expanded. Turning Collapsible off hides this input; turning it back on restores the text you entered. Existing saved block titles are retained for compatibility.
Code Editor and Minimap
The configuration editor uses CodeMirror 6. It provides syntax highlighting, line numbers, code folding where supported by the selected language, bracket matching, auto-indentation, search, and undo/redo. Long lines wrap within the editor.
Enable Minimap to see an overview of long code on the right. Click the overview or drag its viewport indicator to move through the code. Your Minimap preference is saved with the macro.
Bottom Bar
The bottom-left statistics show Language, Theme, Lines, and Characters. Cancel and Save are at the bottom right. These statistics update as you edit.
Languages, Themes, and Formatting
Language Selection
Open Language, type part of a language name, and select a match. Examples include JavaScript, TypeScript, JSX, TSX, Python, Java, C, C++, C#, Go, Rust, PHP, Ruby, HTML, CSS, JSON, XML, SQL, GraphQL, YAML, Markdown, and ASN.1. Choose plain text for content that does not need syntax highlighting.
Language selection controls highlighting; it does not execute your code. If the colors do not look right, reopen the configuration and choose the language that matches the snippet.
Theme Selection
Choose a code theme such as GitHub Light, GitHub Dark, VS Code Light, VS Code Dark, Dracula, Monokai, One Dark, or Nord. Theme changes preview in the editor and apply to the saved code block and its fullscreen view.
The surrounding controls follow the Confluence light or dark appearance. The code area keeps the theme selected in the macro, so a light code theme can appear within a dark Confluence page. To change the code colors, change Theme in the macro configuration.
Format Code
Click Format, or press Ctrl+Shift+F on Windows/Linux or Cmd+Shift+F on macOS while the code editor is focused.
Formatting is available for JavaScript, JSX, TypeScript, TSX, JSON, CSS, SCSS, Less, HTML, Markdown, and YAML. Syntax highlighting supports more languages than formatting does.
Format is disabled for unsupported languages, empty code, or while formatting is in progress. If the formatter cannot parse the code, a message appears and the original text remains unchanged. Review the result before saving; you can undo a successful formatting change in the editor.
Published View
The published block is read-only. Its header shows the title when present, followed by Language, Lines, and Characters on the same row, with controls on the right. The theme name is not displayed in this reading header; the selected theme still controls code colors.
Collapsed View
With Collapsible enabled, readers initially see the header only. Click the right-facing arrow at the far right to expand the code. Clicking the title or the rest of the header does not toggle the block. The fullscreen button is available even while the block is collapsed.
Expanded View
Expanded blocks show highlighted code and line numbers directly below the header. Click the downward arrow to collapse the block again. When Collapsible is disabled, the code stays expanded and the whole-block collapse arrow is not shown.
Copy Code
Move the pointer over the code area to reveal Copy near its upper-right corner, or reach the button with the keyboard. Click it to copy the complete code text. The button briefly confirms success with Copied!. Copy is also available in fullscreen.
If copying fails, check the browser clipboard permissions or select and copy the text manually. For a collapsed block, expand it or open fullscreen first.
Fullscreen View
Click the Open in fullscreen icon (two outward diagonal arrows) on the right of the block header.
Read the code in a viewer that fills the browser viewport. The title, language, line count, and character count remain visible above the code.
Scroll through long code and use Copy as needed. The language and code theme match the original block; the code remains read-only.
To return to the page, click Exit fullscreen in the code header, click the X at the top right of the dialog, or press Esc while the viewer is focused.
Closing fullscreen preserves the original block’s expanded or collapsed state and returns focus to its fullscreen button. Fullscreen enlarges the reading area within Confluence; it does not edit or save the code. Empty code blocks do not show a fullscreen entry.
FAQ
Why does clicking the header not expand the block?
Use the dedicated arrow at the far right. The fullscreen icon is a separate action and opens the code in a larger viewer.
Why is Format unavailable for my language?
Formatting is limited to the languages listed in Format Code above. Other supported languages can still be highlighted and saved.
Does the minimap appear for readers?
No. Minimap is available only in the configuration editor.
Can I edit code in fullscreen?
No. Fullscreen is a read-only viewer. Edit the Confluence page and reopen the macro configuration to change the code.
What should I do if the saved page shows old content?
After saving the macro, wait until the updated preview appears before publishing or updating the Confluence page. Reopen the macro configuration to confirm its saved content if necessary.