Syntax Highlighting

Both Markdown Monster and Documentation Monster utilize HighlightJS for syntax highlighting. They have a default set of languages supported out of the box. Unfortunately, Delphi, Pascal or Lazarus is not one of the supported languages. It is fairly easy to add support for Delphi, Lazarus and Pascal, however, although there are a couple of steps involved.

The overall approach for Markdown Monster is different from that employed by Documentation Monster, so while the objective is to make an additional language supported in your Markdown documentation, actual implementation requires different steps.

The remaining topics provide the step-by-step approach to enabling Delphi, Pascal and Lazarus in both Markdown Monster and Documentation Monster.

Specifying Code Blocks

Code blocks can be specified in three different ways.

  • Indented Markdown Code
  • Github Flavored Code Snippets
  • Paste Code Dialog for quick Code Tasting

The recommended method for code blocks is the Github Flavored method that uses three back-tics followed by a language identifier to open the block, and three back-tics to close the block.

Example: If you code the following Markdown—

```delphi
unit MyUnit;

interface

uses
    System.VCL,
    System.Utilities;
    
implementation
...
end.
```

it renders as:

unit MyUnit;

interface

uses
    System.VCL,
    System.Utilities;
    
implementation
...
end.

For a complete discussion of Embedding Code Shippets see the Markdown Monster documentation Embedding Code Snippets