Basics

Learn about the terms that are used in this documentation and get an overview about the common basics of the Advanced Codeblocks and the Advanced Codeblocks Remote.

User Interface Components

The Advanced Codeblocks user interface is composed of the following components:

  1. codebox

  2. codebox title

  3. menu with contained download links and help

  4. codeblock with codeblock header and codeblock body

  5. download codeblock button

  6. copy to clipboard button

When editing a page, the Advanced Codeblocks interface changes like so:

  1. macro name and parameters

  2. macro body

Terms

The Terms describe the different parts of your Advanced Codeblocks input. Your input is always compound of a config-block and a template.

config-block

A config-block contains your configuration. It is written in the INI file format and has to be defined in the macro-body. Be sure to check for whitespaces beetween the INI-Blocks - there should be no whitespaces.

section

[section]

A config-block contains one or multiple sections. Every section represents one codeblock and could get an arbitrarily name. The section name appears on a line by itself in square brackets.

key

name = value

A section contains one or multiple keys. Every key has a name and a value, delimited by an equals sign. The name can be used as the variable ${name} in your template. The value is the expression that will replace your variable.

content

content

A template will be initiated with the content term. The content term appears on a line by itself in square brackets and may not be renamed. If you use the Advanced Codeblocks Remote, you can leave it off.

template

A template contains the content for your codeblocks. Write your template in any preferred programming language. Insert your template directly in Confluence or load your remote template from any source.

variable

${name}

A variable is a placeholder in your template that will output the values you define in the keys of your config-block. The variable is composed of a dollar sign $ and the name of your key in curly brackets. Feed your template with as much variables as you want to enter repeating code with different values.

Your complete input could look like so:

[section 1]
name1 = value1
name2 = value2
[section 2]
name1 = value3
name2 = value4

[content]
 code
   ${name1}
   ${name2}
 code

Syntax highlighting

To enforce syntax highlighting for a specific language, switch to the edit mode of the app and choose your language from over 150 different programming languages.

Otherwise the language will be auto-detected.

Note: Since App version 4.0.0 there is no language auto-detection anymore, since this can potentially freeze the browser for some time during the page load. If no language is selected no highlighting will be performed.

Themes

The Advanced Codeblocks provides four different themes for a nice readable code. The default Theme is light-spring. If you prefer a colorful dark mode or a colorless variant, switch to the edit mode of the app and choose your preferred theme. Note that the same theme could differ slightly in different languages. The overview below is made with an Apache example:

light-spring

dark-spring

light-mono

dark-mono

Troubleshooting

You might get errors when your input is incorrect, the remote file is too large or your license is expired. An error will look like so:

To fix the error state of the Advanced Codeblocks for Confluence as soon as possible, every error has an error code at the bottom right corner. Please have a look at your appearing error code in the table below to get back on track. An error code for the Advanced Codeblocks looks like AC0001, for the Advanced Codeblocks Remote like ACR0001 and for license errors you get an expression like EXPIRED.

Error Codes and Description

0001
Filesystem Error

There was an unexpected filesystem error.

Cause

This error means that something went wrong with the underlying filesystem. Often this is caused by downloading a file that is too large or any other unexpected error regarding the file system of the Confluence Server.

Solution

Check the following:

  • Is the remote file you are trying to use larger than 2MB? Files must be smaller than 2MB.

0002
Formatting syntax error

You are using an invalid formatting / syntax.

Cause

This error means that your input code is not written in the expectedly syntax.

Solution

Check your input of:

  • Are whitespaces beetween the INI-Blocks? There should be no whitespaces.

  • Does every section and the content appear on a line by itself?

  • Are your sections and the content bracketed in square brackets?

  • Have you named the content [content]?

0003
Invalid URL

The URL to the remote file is not valid.

Cause

This error means that the remote url you are using is not valid.

Solution

Check the URL you are using. You could enter the URL directly in the browser to see if you can navigate to the desired file. Maybe there are some special chars that need to be URL Encoded, whitespaces or any other invalid characters.

0004
Download Error

There has been an error downloading the file.

Cause

This error means that while downloading the remote file an HTTP Error occured.

Solution

Check the following cases:

  • If HTTP 403: You entered correct Username and Password

  • If HTTP 401: The file is protected by Basic Auth and you need to enter Username and Password for downloading.

  • If HTTP 404: The URL of the remote file leads to a non existing file.

  • If HEAD Request error: Make sure that the Server that hosts your remote file does support HTTP HEAD requests.

0006
Empty macro body

Feed the Advanced Codeblocks with content! To see the preview the app needs content.

Cause

This info appears if the macro body has not already inserted content.

Solution

Insert content in the macro body.

0007
Allowlist Problem

The URL you are using is not allowlisted by your Confluence Administrator.

Cause

The URL you are using is not allowlisted by your Confluence Administrator.

Solution

Ask your Confluence Administrator to put your URL on the Allowlist.

0008
Chunked Transfer Exception

You tried to download a file that is greater than 2MB that was sent with Transfer-Encoding: chunked.

Cause

When sending a file with Transfer-Encoding chunked it comes in small parts. The filesize cannot be determined beforehand. When the 2MB limit is reached the download is stopped.

Solution

Try reducing the filesize below 2MB.

0009
Macro Preview unavailable

Your are currently working on an unsaved page that is in draft-mode. That means the page is new and was never saved before.

Cause

There is no macro preview available for content in draft mode. Because the security checks if a user has permissions on the page fail, since it is no real page yet.

Solution

Please save the page first, then the macro preview will be available.

EXPIRED
Invalid license

Your evaluation license of Advanced Codeblocks for Confluence expired. Please use the 'Buy' button to purchase a new license.

Cause

A license is invalid if the current date is greater than or equal to the license's expiration date.

Solution

Please use the 'Buy' button to purchase a new license.

TYPE_MISMATCH
Invalid license

Your evaluation license of Advanced Codeblocks for Confluence expired. Please use the 'Buy' button to purchase a new license.

Cause

A license is invalid if its type (commercial, developer, academic, etc.) is incompatible with the type of the application license.

Solution

Please use the 'Buy' button to purchase a new license.

USER_MISMATCH
Invalid license

Your Advanced Codeblocks for Confluence is only licensed for ... users. Your ... installation requires a license for ... users. Please get a Advanced Codeblocks for Confluence license for ... users and try again.

Cause

A license is invalid if its maximum number of users property is less than that of the application license.

Solution

Please use the 'Buy' button to purchase a new license.

VERSION_MISMATCH
Invalid license

Your license for maintenance of Advanced Codeblocks for Confluence is not valid for version X.Y.Z. Please use the 'Renew' button to renew your Advanced Codeblocks for Confluence license.

Cause

A license is invalid if the app's build date is greater than or equal to the license's maintenance expiration date.

Solution

Please use the 'Renew' button to renew your license.

If you are lost after all, issue a request in the codeclou Service Desk.

HTTP REST API

The REST API documentation has moved and resides on its on dedicated page since app version 3.0.0. Click here.

Supported Languages

The supported languages for code highlighting are currently:

languages
1C
ABNF
Access logs
Ada
ARM Assembly
AVR Assembler
ActionScript
Apache
AppleScript
AsciiDoc
AspectJ
AutoHotkey
AutoIt
Awk
Axapta
Bash
Basic
BNF
Brainf***
C#
C++
C/AL
Cache Object Script
CMake
Coq
CSP
CSS
Cap n Proto
Ceylon
Clojure
Clojure REPL
CoffeeScript
Crmsh
Crystal
D
DNS Zone file
DOS .bat
Dart
Delphi
Diff
Django
Dockerfile
dsconfig
DTS (Device Tree)
Dust
EBNF
Elixir
Elm
ERB (Embedded Ruby)
Erlang
Erlang REPL
Excel
F#
FIX
Fortran
G-code (ISO 6983)
Gams
GAUSS
Gherkin
Go
Golo
GLSL
Gradle
Groovy
HTML, XML
HTTP
Haml
Handlebars
Haskell
Haxe
Hy
Ini
Inform 7
Intel x86 Assembly
IRPF90
Java
JavaScript
JSON
Julia
Kotlin
Lasso
LDIF
Leaf
Less
Lisp
LiveCode
LiveScript
Lua
Makefile
Markdown
Mathematica
Matlab
Maxima
MEL
Mercury
Mizar
Mojolicious
Monkey
Moonscript
N1QL
NSIS
Nginx
Nimrod
Nix
Objective C
OCaml
OpenGL Shading Language
OpenSCAD
Oracle Rules Language
Oxygene
Parser3
Perl
pf
PHP
Pony
PowerShell
Processing
Prolog
Protocol Buffers
Puppet
Python
Python profile
Q
QML
R
RenderMan RIB
RenderMan RSL
Roboconf
Ruby
Rust
Scala
Scheme
Scilab
SCSS
Shell
Smali
Smalltalk
SML
SQL
Stan
Stata
STEP Part 21 (ISO 10303-21)
Stylus
SubUnit
Swift
Tcl
Test Anything Protocol
TeX
Thrift
TP
Twig
TypeScript
Vala
VB.NET
VBScript
VBScript in HTML
Verilog
VHDL
Vim Script
XL
XML
XQuery
Zephir