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 parameters are shown on the right side

Terms

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

config

A config contains your configuration. It is written in the INI file format.

section

[section]

A config 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.

template

or code

A template (or code) 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:

config
[section 1]
name1 = value1
name2 = value2
[section 2]
name1 = value3
name2 = value4
code
code
   ${name1}
   ${name2}
 code

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

Dark Mode

The App supports the Confluence Dark Mode. The selected theme will also switch automatically to its dark pendant.

Bidi Character Support

The App supports display of Bidi Characters in a special way.

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 key that is shown once you click on 'Error Key'. Please have a look at your appearing error key in the table below to get back on track. An error key for the Advanced Codeblocks looks like 400_ERROR_... or similiar.

Error Keys and Description

400_ERROR_
MACRO_CODE_EMPTY
MACRO_CONFIG_EMPTY

The macro config or code is empty.

Cause

This error means that you have not fully configured the macro yet. Not all required macro parameters have been filled out.

Solution

Check your input of:

  • Have you entered a value for code?

  • Have you entered a value for config?

400_ERROR_
MACRO_CONFIG_INI_FORMAT_INVALID
MACRO_CONFIG_NO_SECTIONS

You are using an invalid syntax or formatting for the config.

Cause

This error means that your config 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 appear on a line by itself?

  • Are you using the correct INI-format with sections? Try this for example: [test]\nvar1 = foo

400_ERROR_
MACRO_REMOTEURL_INVALID
MACRO_REMOTEURL_EMPTY

The URL to the remote file is not valid or empty.

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.

500_ERROR_
FETCH_HTTP_NOT_200
FETCH_OTHER

There has been an error downloading the remote 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.

200_INFO_
PAGE_IS_DRAFT

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 might be no macro preview available for content in draft mode.

Solution

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

500_ERROR_
UNEXPECTED_CATCH_BRIDGE

An unexpected error occured that was catched in the app-frontend.

Cause

When an unexpected error occurs that cannot be handled by the app, then it is the last resort to display it to the user.

Solution

Please open a ticket at the service desk with a screenshot of the problem.

500_ERROR_
LICENSE_EXCEPTION

Your license for Advanced Codeblocks for Confluence is not valid.

Cause

The app license is invalid.

Solution

Please use the 'Buy' or 'Renew' button to buy or renew your license.

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

Syntax highlighting

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

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