Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Java

...

Confluence prism macro
lineNumberstrue
downloadFilenameHelloWorld.java
lineHighlight3-8
languageJava
public class Factorial
{
  public static void main(String[] args)
  {
    final int NUM_FACTS = 100;
    for(int i = 0; i < NUM_FACTS; i++)
      System.out.println(i + "! is " + factorial(i));
  }
	
  public static int factorial(int n)
  {	
    int result = 1;
    for(int i = 2; i <= n; i++)
      result *= i;
    return result;
  }
}
Info

The source code above is an interactive live demo of Prism Syntax Highlighter for Confluence that shows some of the features:

  • Source code downloading: Click the “Download” button in the toolbar on the top right to download the source code.

  • Copy & paste support: Click the “Copy” button in the toolbar on the top right to copy the source code to the clipboard.

  • Line number & line highlighting: Line numbers are shown and lines 3 to 8 are highligted.

  • Brace matching: Hover over the braces to see the interactive brace matching.

Remote source code (from GitHub)

Confluence prism macro remote
lineNumberstrue
downloadFilenameReadme.md
languageMarkdown
urlhttps://raw.githubusercontent.com/PrismJS/prism/master/README.md
height500px

...

The source code above is an interactive live demo of Prism Syntax Highlighter for Confluence that includes (markdown) code from GitHub (https://raw.githubusercontent.com/PrismJS/prism/master/README.md). Besides including the code from the remote location the demo shows some of the other features:

...

Source code downloading: Click the “Download” button in the toolbar on the top right to download the source code.

...

Copy & paste support: Click the “Copy” button in the toolbar on the top right to copy the source code to the clipboard.

...

source code

Image Added

Java (like 260+ other languages) source code can be rendered with syntax highlighting and other nice features. Click here to see the live demo.

CSS (Cascading Style Sheets) code

Image Added

CSS (like 260+ other languages) source code can be rendered with syntax highlighting and other nice features such as previewers when hovering certain definitions. Click here to see the live demo.

Markdown remote source code

Image Added

Source code from remote locations (such as GitHub) can be rendered with syntax highlighting and other nice features. Click here to see the live demo.

Bash command line

Image Added

A Bash command line can be rendered including (input) command and the corresponding output. Click here to see the live demo.

PowerShell command line

Image Added

A PowerShell command line can be rendered including (input) command and the corresponding output. Click here to see the live demo.

SQL command line

Image Added

A SQL command line can be rendered including (input) command and the corresponding output. Click here to see the live demo.

Diff output

Image Added

A diff output can be rendered that shows the added and removed lines. Click here to see the live demo.

Directory treeview

Image Added

A directory treeview can be rendered including subfolder and files. Live Demo - Directory Treeview.