Documentation

Please check out our YouTube video or our Live demo to get an idea about how Prism Syntax Highlighter for Confluence works.

Installation

As any app for Confluence Cloud, you can install the app via the Confluence admin menu.

  1. Log into your Confluence instance as an admin.

  2. Click on “Apps > Manage apps” in the header menu.

  3. Click on “Find new apps” on the right navigation.

  4. Search for “Prism Syntax Highlighter for Confluence” and select it.

  5. Click on “Try it free” to install the app.

Usage

Macros “Prism syntax highlighter” & "Prism syntax highlighter (Remote)"

Prism Syntax Highlighter for Confluence provides two macros to highlight source code on any Confluence page. One macro can be used to define the source code in the macro’s body in Confluence and the other macro includes the source code from a remote location (such as GitHub). To make use of the first option click the “Insert” / “+” Button in the edit mode and select the “Prism Syntax Highlighter” macro and add the source code as macro body. To include source code from a remote location add the “Prism Syntax Highlighter (Remote)” macro and set the macro option “URL” to the remote location.

Both macros support the following options:

  • Language: Select the language of the source code to highlight.

  • Height: Optionally define the macro’s height.

  • Limit height: Check to limit the defined macro’s height to the actual source code height.

  • Line numbers: Check to add line numbers.

  • First line number: If “Line numbers” option is checked, this options defines the line number to start from (leave empty to start from 1).

  • Lines(s) to highlight: Add the lines that should be highlighted in format “1-2,5,9-20”.

  • Download filename: Add a filename to allow downloading the source code.

  • Dialog title: Add a dialog title to allow opening the source code in a fullscreen dialog.

  • Show previews: Check to show previews (works for CSS, Less, Markup attributes, Sass, Scss and Stylus source code)

  • Show invisibles: Check to show hidden characters such as tabs and line breaks.

  • Clickable links: Check to convert URLs and emails in code to clickable links.

The “Prism Syntax Highlighter (Remote)” macro specific options are

  • URL: URL to load the remote source code from

  • Server side: Check to load remote content from the server side to overcome CORS issues

Macros "Prism command line highlighter (Bash)", "Prism command line highlighter (PowerShell)" & “Prism command line highlighter (SQL)“

Prism Syntax Highlighter for Confluence provides three macros to render a Bash, a PowerShell or a SQL command line on any Confluence page. The (input) commands and the output lines are defined in the macro’s body. To make use of this option click the “Insert” / “+” Button in the edit mode and select the corresponding macro and add the command line content as macro body.

The macros support the following options:

  • Only macro "Prism command line highlighter (Bash)"

    • User: User that should be rendered in the command line.

    • Host: User that should be rendered in the command line.

  • Only macro "Prism command line highlighter (PowerShell)"

    • Directory: Current (working) directory that should be rendered in the command line.

  • Only macro "Prism command line highlighter (SQL)"

    • Server: Server (suffixed) with “>” is shown as prompt

  • Height: Optionally define the macro’s height.

  • Limit height: Check to limit the defined macro’s height to the actual source code height.

  • Dialog title: Add a dialog title to allow opening the source code in a fullscreen dialog.

An example content for the macro "Prism command line highlighter (Bash)" could look as follows:

Please note that all lines prefixed with “(out)” (without the quotes) in the macro body are handled as output, all other lines are handled as input (commands) when rendering the command line.

An example content for the macro "Prism command line highlighter (SQL)" could look as follows:

Please note that all lines prefixed with “(out)” (without the quotes) in the macro body are handled as output, all other lines are handled as input (commands) when rendering the command line. Lines prefixed with “(con)“ (without the quotes) are handled as continuation input lines.

Macro "Prism directory treeview"

Prism Syntax Highlighter for Confluence provides a macro to render a directory treeview. To make use of this option click the “Insert” / “+” Button in the edit mode and select the "Prism directory treeview" macro and add the treeview as macro body (see below for an example).

The macros support the following options:

  • Height: Optionally define the macro’s height.

  • Limit height: Check to limit the defined macro’s height to the actual source code height.

  • Dialog title: Add a dialog title to allow opening the source code in a fullscreen dialog.

An example content for the macro "Prism directory treeview" could look as follows:

App configuration

As a Confluence administrator you can access the app’s global configuration page via the “Configure” button under “Apps > Manage apps”.

The app offers the following (global) settings which are applied to all Prism Syntax Highlighter for Confluence macros (in all spaces):

  • Data Protection Mode: If enabled, all data processing takes place only within the Atlassian cloud and within the user's browser. This is implemented by disabling those features where data processing on the app’s servers (managed by weweave) is required.

  • Hide “Data Protection Mode” errors in Confluence Word or PDF exports: If enabled (only possible in combination with enabling “Data Protection Mode”), Confluence Word and PDF exports do not include macros (errors). Instead, macros are just “skipped” in exports.

  • Custom CSS: Global (custom) CSS to apply additional stylings to the source code rendering (see below for examples).

image-20241114-121030.png

Custom CSS

To customize the rendering of the Prism macros, custom CSS code can be defined on a global (Confluence) level.

The following examples adds a red border to all line highlightings:

Supported languages

Prism Syntax Highlighter for Confluence supports the following languages:

  • ABAP

  • Augmented Backus–Naur form

  • ActionScript

  • Ada

  • Agda

  • AL

  • ANTLR4

  • Apache Configuration

  • Apex

  • APL

  • AppleScript

  • AQL

  • Arduino

  • ARFF

  • ARM Assembly

  • Arturo

  • AsciiDoc

  • 6502 Assembly

  • ASP.NET (C#)

  • Atom

  • AutoHotkey

  • AutoIt

  • AviSynth

  • Avro IDL

  • AWK + GAWK

  • Bash

  • BASIC

  • Batch

  • BBcode

  • BBj

  • Bicep

  • Birb

  • Bison

  • Backus–Naur form

  • BQN

  • Brainfuck

  • BrightScript

  • Bro

  • BSL (1C:Enterprise) + OneScript

  • C

  • C-like

  • Concurnas

  • C#

  • C++

  • CFScript

  • ChaiScript

  • CIL

  • Cilk/C

  • Cilk/C++

  • CoffeeScript

  • CMake

  • COBOL

  • Clojure

  • Crystal

  • Content-Security-Policy

  • Cooklang

  • Coq

  • CSS

  • CSS Extras

  • CSV

  • CUE

  • Cypher

  • D

  • Dart

  • DataWeave

  • DAX

  • Dhall

  • Diff

  • Django/Jinja2

  • DNS zone file

  • Docker

  • DOT (Graphviz)

  • Extended Backus–Naur form

  • EditorConfig

  • Eiffel

  • EJS

  • Elixir

  • Elm

  • Embedded Lua templating

  • ERB

  • Erlang

  • Excel Formula

  • F#

  • Factor

  • False

  • Firestore security rules

  • Flow

  • Fortran

  • FreeMarker Template Language

  • G-code

  • GDScript

  • GEDCOM

  • gettext

  • Gherkin

  • Git

  • GLSL

  • GameMaker Language

  • GAP (CAS)

  • GN

  • GNU Linker Script 

  • Go

  • Go module

  • Gradle

  • GraphQL

  • Groovy

  • Haml

  • Handlebars

  • Haskell

  • Haxe

  • HCL

  • HLSL

  • Hoon

  • HTML

  • HTTP

  • HTTP Public-Key-Pins

  • HTTP Strict-Transport-Security

  • IchigoJam

  • Icon

  • ICU Message Format

  • Idris

  • Ignore Files

  • Structured Text (IEC 61131-3)

  • Inform 7

  • Ini

  • Io

  • J

  • Java

  • JavaDoc

  • JavaDoc-like

  • JavaScript

  • Java stack trace

  • Jexl

  • Jolie

  • JQ

  • JSDoc

  • JS Extras

  • JSON

  • JSON5

  • JSONP

  • JS stack trace

  • JS Templates

  • Julia

  • Keyman

  • Kotlin

  • KuMir

  • Kusto

  • LaTeX

  • Latte

  • Less

  • LilyPond

  • LiquidLisp

  • LiveScript

  • LLVM IR

  • Log file

  • LOLCODE

  • Lua

  • Magma (CAS)

  • Makefile

  • Markdown

  • Markup

  • Markup templating

  • Mata

  • MathML

  • MATLAB

  • MAXScript

  • MEL

  • Mermaid

  • METAFONT

  • Mizar

  • MongoDB

  • Monkey

  • MoonScript

  • N1QL

  • N4JS

  • Nand To Tetris HDL

  • Naninovel Script

  • NASM

  • NEON

  • Nevod

  • nginx

  • Nim

  • Nix

  • NSIS

  • Objective-C

  • OCaml

  • Odin

  • OpenCL

  • OpenQasm

  • Oz

  • PARI/GP

  • Parser

  • Pascal

  • Pascaligo

  • PATROL Scripting Language

  • PC-Axis

  • PeopleCode

  • Perl

  • PHP

  • PHPDoc

  • Plant UML

  • PHP Extras

  • PL/SQL

  • PowerQuery

  • PowerShell

  • Processing

  • Prolog

  • PromQL

  • .properties

  • Protocol Buffers

  • Pug

  • Puppet

  • Pure

  • PureBasic

  • PureScript

  • Python

  • Q (kdb+ database)

  • Q#

  • QML

  • Qore

  • R

  • Racket

  • Razor C#

  • React JSX

  • React TSX

  • Reason

  • Regex

  • Rego

  • Ren'py

  • ReScript

  • reST (reStructuredText)

  • Rip

  • Roboconf

  • Robot Framework

  • RSS

  • Ruby

  • Rust

  • SAS

  • Sass (Sass)

  • Sass (Scss)

  • Scala

  • Scheme

  • Shell session

  • Smali

  • Smalltalk

  • Smarty

  • SML + SML/NJ

  • Solidity (Ethereum)

  • Solution file

  • Soy (Closure Template)

  • SPARQL

  • Splunk SPL

  • SQF: Status Quo Function (Arma 3)

  • SQL

  • Squirrel

  • Stan

  • Stata Ado

  • Stylus

  • SuperCollider

  • SVG

  • Swift

  • TAP

  • Tcl

  • Textile

  • TOML

  • Template Toolkit 2

  • Turtle

  • Twig

  • TypeScript

  • TypoScript + TSConfig

  • Systemd configuration file

  • T4 Text Templates (C#)

  • T4 Text Templates (VB)

  • T4 templating

  • UnrealScript

  • UO Razor Script

  • URI + URL

  • V

  • Vala

  • VB.Net

  • Velocity

  • Verilog

  • VHDL

  • vim

  • Visual Basic

  • Visual FoxPro

  • WarpScript

  • WebAssembly

  • Web IDL

  • WGSL

  • Wiki markup

  • Wolfram language + Mathematica + Mathematica Notebook

  • Wren

  • Xeora

  • XML

  • XML doc (.net)

  • Xojo (REALbasic)

  • XQuery

  • YAML

  • YANG

  • Zig