Learn about additional features provided by the Code Block Macro provided by the projectdoc Toolbox.

The Code Block Macro makes it easy to render code snippets beautifully. The Code Block Placeholder Macro version provided by the projectdoc Toolbox connects the configuration to properties defined by the document or space.

 

Rendering Code

 

Code Block Macro

The plain code in the macro body:

The macro is rendered as follows:

Dependency Snippet
<pluginArtifacts>
  <pluginArtifact>
    <groupId>de.smartics.atlassian.confluence</groupId>
    <artifactId>smartics-projectdoc-confluence</artifactId>
    <version>1.10</version>
  </pluginArtifact>
</pluginArtifacts>

Code Block Placeholder Macro

The code with placeholders in the macro body:

The macro is rendered as follows:

Dependency Snippet
<pluginArtifacts>
  <pluginArtifact>
    <groupId>de.smartics.atlassian.confluence</groupId>
    <artifactId>smartics-projectdoc-confluence</artifactId>
    <version>1.10</version>
  </pluginArtifact>
</pluginArtifacts>

The properties may be either defined in the page as document properties or on the homepage of the space as space properties. In either case the fragment in the table enclosed in the Document Properties Marker Macro looks like this:

This allows to change the values in a central place.

Summary

The Code Block Macro is a great tool to render visually appealing code on a page.

The Code Block Placeholder Macro adds features to use placeholders within the code to be replaced with document and space properties.

The following table lists features that are related to one of the macros discussed, but are implemented by different macros. In this case the macro providing the feature is listed. No extra cost is involved to use the mentioned macros, since all these macros are either part of Confluence or the projectdoc Toolbox Add-on.

FeatureCode Block MacroCode Block Placeholder Macro
Renders Highlighted CodeYESYES
Replacements with Document PropertiesNOYES
Replacements with Space PropertiesNO

YES

Transclude Documents Macro

CostFREESTARTS WITH $10
see prices for more users
No Extra Installation requiredYESNO
VendorAtlassiansmartics