Code Formatting Reference

You can customize the way your Heretto Deploy Portal shows code snippets.

Common Customizations

You can overwrite the default settings by editing the config.json file.

"outputClasses": {
  "outputclass": [
    "is-code-format",
    {
        "linenums": "linenums_bool",
        "copyable": "copyable_bool",
        "theme": "codeblock_theme",
        "linenums-decorator": "linenum_decorator_str"
    }
  ]
},
outputclass

Defines the @outputclass attributes of DITA elements that you want to style. For example:

  • .codeblock

  • .pre

linenums_bool

If true, shows line numbers in code blocks. If false, hides line numbers in code blocks.

copyable_bool

If true, shows the copy code button. If false, hides the copy code button.

codeblock_theme

Defines the highlight.js theme, for example: stackoverflow-light.

linenum_decorator_str
"outputClasses": {
  ".codeblock": [
    "is-code-format",
    {
        "linenums": true, 
        "copyable": true, 
        "theme": "stackoverflow-light",
        "linenums-decorator": " "
    }
  ]
},