MarkAPL Cheatsheet

This document comes with examples for most of the features offered by MarkAPL. The documentation is however not comprehensive: it provides just enough information to get you going.

For a comprehensive documentation refer to or, if you use MarkAPL within an APL workspace, call the function MarkAPL.Reference 0.

Note that all the features related to the so-called LeanPub extensions are discussed in a separate document.

1. Headers

These are the standard ways to mark-up headers:

# Level 1
## Level 2
### Level 3
#### Level 4
##### Level 5
###### Level 6

Note that headers may contain only text and code but nothing else.

Headers of level 1 and 2 can also be produced with = and -:

This is a level 1 header

This is a level 2 header

Note that before and after such a header a blank line is required.

2. APL code

APL code can be presented to the reader either as a code block or as in-line mark-up, meaning that the APLcode is embedded into a paragraph or cell etc.

3. Tables

|Name     |Remark     |No. of users|
| APL     | Brilliant |        800 |
| Cobol   |       Old |      14000 |
| F#      |      Newer|       3400 |
| Haskell |       New |       3400 |
| Java    |       Just|         74 |
|Total    |           |      21674 |


Name Remark No. of users
APL Brilliant 800
Cobol Old 14000
F# Newer 3400
Haskell New 3400
Java Just 74
Total 21674

Simplest possible table: one column, no header, no alignment, no footer:





4. Lists

List may start right after a paragraph. They break at two empty lines.

4.1. Ordered lists

2. Second
2. Third


  1. Second
  2. Third

4.2. Unordered lists

* This
* That


4.3. Nested lists

Note that indentation defines what belongs to what.

* This
* That

  A para belonging to <That>

  10. Ten
  1.  Eleven

      A para belonging to <Eleven>

  Another para belonging to <That>

* More


Lists may contain paragraphs, code blocks, sub lists and, since version 3.0, tables, blockquotes and images.

5. Blockquotes

> This is a blockquote. Note that a blockquote may contain anything: paragraphs, lists, code blocks, tables, headers, definition lists and even blockquotes.


This is a blockquote. Note that a blockquote may contain anything: paragraphs, lists, code blocks, tables, headers, definition lists and even blockquotes.

> > Nested Blockquote.


Nested Blockquote.

6. Code blocks

Code blocks can be marked up in two different ways:

6.1. Standard markdown fencing

This requires 3 tilde characters:




You can mention the programming language after the opening fence as shown here:


6.2. Info string and special attributes

A code block may have an info string or special attributes or both; see the full MarkAPL reference for details.

6.3. “Git” style fencing

This requires 3 ticks:


The result is the same as before.

7. Definition list

: Best programming language ever

: Oh dear


Best programming language ever
Oh dear

8. Footnotes

Footnotes can be defined anywhere in the document. They cannot contain anything but paragraphs.

The format of the definition:

[^footnote]: A multi-line definition.
  As long as the following paras are indented by two spaces they are considered
  part of the footnote.

  Even an empty line doesn't interrupt the definition, although two do. In-line
  formatting **is** of course supported.


9. Horizontal lines



10. Paragraphs

Everything that is not identified as something else is considered a paragraph.

11. In-line mark-up

11.1. Bold and italic

The examples use the terms “bold” and “italic” though strictly speaking this is about getting <em> and <strong> into the HTML. How <em> and <strong> are actually displayed depends on the CSS styling, though all browser default styles make <em> look italic and <strong> bold, but you might well change this.



A para can contain **bold**, *italic* and **_bold and italic_**.

result in this:

A para can contain bold, italic and bold and italic.

** and __ are interchangeable, and so are * and _ with the exception that * and ** can be used to highlight letters within a word while _ and __ cannot:

11.2. In-line code

In-line code can be marked up by enclosing the code with backticks:

This `{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}` is an example.


This {{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵} is an example.

However, there is much more to this than that once you need to include one or more backticks inside the code; in short you have to enclose any code block between one more backticks then you want to show. For example, if you want to show two backticks:

``` These are two (``) backticks```

This results in These are two (``) backticks

Refer to the full documentation for details and other possible complications.

11.3. Strike-through

This feature ~~is not available~~ was introduced in version x.y

This feature is not available was introduced in version x.y

11.4. Syntactical sugar

Available options:
* --- (m-dash)
* -- (n-dash)
* (c) (copyright)
* (tm) (trade mark)
* ... (ellipses)
* <<Guillemets>>
* ==> (right arrow)
* <== (left arrow)
* <==> (left-and-right arrow)


Available options:

11.5. Double quotes

Pairs of double-quotes (\") are exchanged against their typographically correct equivalents "like here".


Pairs of double-quotes (") are exchanged against their typographically correct equivalents “like here”.

Note that Germany, Austria and Switzerland use different characters. MarkAPL looks at the HTML parameter lang in order to decide which to choose. See the MarkAPL reference for details.

Note that a double-quote can — like any other character — be escaped by a \ character. However, escaping is an issue more complex than you might think. Please refer to the reference for details.

11.6. Special HTML characters: <&>

Since Markdown is a writing format it is easy to write about <html> & use tags.


Since Markdown is a writing format it is easy to write about <html> & use tags.

11.7. Links

11.7.1. External links

External links with
[The APLTree library on GitHub](
and without link text:


External links with The APLTree library and without link text:

Note that you must specify a protocol (“http://”, “https://”, “ftp://” etc), otherwise it is not going to be converted. However, if the link contains a @ characters it is assumed to be an email address, and the link is converted to a “mailto:” link, so there is no need to specify anything but just the email address.

You can add a title as well as Special attributes to an external link:

[The APLTree project on GitHub]( "This link brings you to the APL wiki"{target="_blank"})

This is the result:

The APLTree project on GitHub

The title is shown when you hover with your mouse over the link.

11.7.2. Automated links

A special version of an external link is the so-called automated link. Such a link is suitable only in case the url as such is going to be the link text:


Note that such a link must specify a protocol like “http://”, “https://”, “ftp://” etc. The exception is when there is a @ part of the link: in that case it is converted to a “mailto:” link in any case.

11.7.3. Internal links

Since MarkAPL assigns automatically anchors to all headers you can establish a link with

[{Link text}]({Caption})

You can link to such a header in the current document with a simplified syntax in case the link text is exactly the caption:

Link to the [headers](#) section.

Do not use this MarkAPL-specific feature if your document will be rendered by other means than MarkAPL, most notably GitHub and the likes (!) because that would not work.

Link to the Headers section.

Naturally it is important that every single header has a unique ID in order to make this work. Therefore MarkAPL converts any header to an ID. MarkAPL has quite a complex set of rules for how to do this. See MarkAPL's full documentation for details.

If MarkAPL encounters the same header again then it will add a number to it in order to tell them apart. It will report this on

In such cases — which should be rare, really — it is a better idea to assign a unique ID via Special attributes. Of course you must then use this ID when linking to that header, so the simplified syntax is not an option in such cases.

Sometimes the header text does not really fit as link text. Overcome this by specifying:

Link to the [headers](# "Link text") section.

11.7.4. Link references

Link references consists of two parts:

  1. The definition of a link ID together with its URL.
  2. References to the link ID.

The definition of such a reference can go anywhere in the document but usually they go to the bottom.

Examples for definitions:

[git]: "Linus' brain child"{target="_blank"}
[vector]: "The well-respected Journal of the British APL Association"

You can use the IDs to inject the links into, say, a paragraph:

This paragraph links to [][1], [][git] and [the APL Journal][vector].

This paragraph links to, Linus' brain child and The APL Journal.

Note that Special attributes can be defined in the definition part but not the link part.

12. Images

![Dots]( "APL Team's dots")


13. Special attributes

Sometimes one wants to assign special attributes to a certain element. Typical candidates are images, links and tables, although special attributes can assigned to most tags.

This can be achieved by specifying those attributes by putting them to the right of the object in question, enclosed by curly brackets.

For example, in order to specify width and height for an image, add a description and center both, image and description:

![]( {height="70" width="60" style="display:block;margin:auto;"})
_The logo_ {style="text-align:center;font-size:70%;padding-top:0;margin-top:-5px;"}

The logo

Note that the first set of special attributes is assigned to the image as such, while the second set is assigned to the paragraph that comprises “The logo”.

You can also assign class and ID to an object via this syntax:

The logo
{#logo .center .red}

This is how the resulting HTML code would look like:

<p id="logo" class="center red">The logo</p>

Note that with links any special attributes must be part of the link definition. That means they must be specified to the left of the closing glyph, be it a > or a ).

14. Helpers

There are helper methods available that are designed to help an APL programmer to convert data in a workspace into Markdown.

14.1. Matrix2MarkdownList

If you have a matrix in APL then you can easily convert this into Markdown by calling the method Matrix2MarkdownList.

Note that the matrix must have three columns:

  1. List type. A 0 defines a bulleted list. Any positive integer starts an ordered list, and defines at the same time the starting point.
  2. Nesting level. The first row must start with nesting level 0 or 1.
  3. Either a text vector or a vector of text vectors.

This is an example:

 m,←⊂0 1 'Level 1 a bull'
 m,←⊂2 2 'Level 2 a num'
 m,←⊂2 2('Level 2 b num' '' 'Another para' '' '~~~' '{+⌿⍵}' '~~~')

14.2. Matrix2MarkdownTable

If you have a matrix in APL then you can easily convert this into Markdown by calling the method Matrix2MarkdownTable.


Note that via the left argument column headers can be specified. You can use leading and/or trailing colons to define column alignment.


      m←3 3⍴'Kai' 1000 'Remark' 'Thomas' 20 'Blah' 'Max' ¯1 'Foo'
      ch←'Name' 'Points' ':Comments:'
      ⎕←⍪ch #.MarkAPL.Matrix2MarkdownTable m
Name Points Comments
Kai 1000 Remark
Thomas 20 Blah
Max ¯1 Foo

15. Inject data

You can inject key/value pairs into a Markdown document with this syntax:

[data]:name='Kai Jaeger'

MarkAPL itself does not take advantage of such data but you can by referring to it via

For details refer to the MarkAPL reference document.

16. Inject parameters

With this syntax you can inject key/value pairs into a Markdown document representing parameters:

[parm]:toc=1 2 3
[parm]:title='My own title'

Such lines must be the first ones in any document.

MarkAPL will use these parameters to overwrite any defaults or settings via a parameter namespace.

For details refer to the MarkAPL reference document.

17. Version

This document refers to version 11.0 of MarkAPL.
Kai Jaeger ⋄ APL Team Ltd ⋄ 2021-04-14