Cheatsheet

This document contains examples for most of the features offered by MarkAPL. The examples given are not comprehensive: it's just enough information to get you going.

For a comprehensive documentation refer to http://download.aplteam.com/MarkAPL.html.

Headers

These are the standard ways to mark-up headers:

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

APL Code

First of all code can be either marked up as in-line code (within a paragraph, a list item, a block quote and a grid cell but not a header) or as a code block standing on its own.

In-line code

In-line can be marked up by enclosing the code with ticks.

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

Result:

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

Code blocks

Code blocks can be marked up in several ways:

“Git” style fencing

This requires 3 ticks as shown here:

```
{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}
```

Result:

{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}

“Extra” style fencing

This requires 3 ~ as shown here:

~~~
{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}
~~~

Result:

{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}

Tables

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

Result:

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

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

--|
10|
20|
30|

Result:

10
20
30

Notes:

Lists

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

Ordered lists

2. Second
2. Third

Result:

  1. Second
  2. Third

Unordered lists

* This
* That

Result:

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

Result:

Blockquotes

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

Result:

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

> > Nested Blockquote.

Result:

Nested Blockquote.

Definition list

APL
: Best programming language ever

COBOL
: Oh dear

Result:

APL
Best programming language ever
COBOL
Oh dear

Horizontal lines

---

Result:


Paragraphs

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

In-line mark-up

In-line mark-up can be used in paragraphs, lists, tables, blockquotes, definition lists and headers.

Bold and italic

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

Result:

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

In-line code

A para can contain `inline code {+⌿⍴⍵}`.

Result:

A para can contain inline code {+⌿⍴⍵}.

Strike-through

This feature is not implemented was implemented in version 9.0

Syntactical sugar

Available options:
* --- (m-dash)
* -- (n-dash)
* (c) (copyright)
* (tm) (trade mark)
* ... (ellipses).

Result:

Available options:

Typographic quotes

Typographically "correct" quotes are supported as well.

Result:

Typographically “correct” quotes are supported as well.

Special HTML characters: < & >

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

Result:

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

Links

Links are supported in two flavours: external and internal ones.

External links

External links with [APL wiki](http://aplwiki.com) and without link text: <http://aplwiki.com>

Result:

External links with APL wiki and without link text: http://aplwiki.com

Internal links

You can link to a header in the current document with a simplified syntax:

Link to the [headers](#) section.

Link to the headers section.

Naturally it is important that every single header has a unique ID in order to make this work. If MarkAPL encounters the same header again then it will add a number to it in order to tell them apart. However, in such cases — which should be rare, really — it is a better idea to assign a unique ID via special attributes.

MarkAPL has quite a complex set of rules how a header is converted into an ID. See MarkAPL's full documentation for details.

Images

![Dots](http://download.aplteam.com/APL_Team_Dots.png "APL Team' dots")

Dots

Special attributes

Often one wants to assign special attributes to a certain element. Typical candidates are images and tables.

This can be achieved by specifing 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:

![](http://download.aplteam.com/APL_Team_Dots.png){height="70" width="60" style="display:block;margin:auto;"}
_The logo_ {style="text-align:center;font-size:70%;padding-top:0;margin-top:-10px;"}

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>

Helpers

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

Matrix2Markdown

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

Defaults:

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

Examples:

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