Writing Markdown

Editorial is optimized for writing Markdown, a popular plain text format that is very readable, and works well for writing on the web.

In the words of John Gruber, the inventor of Markdown:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.

The following is just a quick overview of how you can format your text using Markdown. For all the details, please refer to the syntax reference on the official Markdown project page.

Markdown Primer

Paragraphs

Paragraphs in Markdown are separated by blank lines. A single line break does not result in a new paragraph.

Headers

Headers are marked with one or more hash characters. Example:

# This is a Level 1 Heading

## This is a Level 2 Heading

Markdown also supports using “Setext-style” headers (underlining the header with === or ---), but this is currently not supported by Editorial’s inline preview. It does work in the full HTML preview however.

Blockquotes

Blockquotes are indicated by a leading > character, like in plain text email. Example:

> Any intelligent fool can make things bigger, more complex, and more violent.
> It takes a touch of genius -- and a lot of courage -- to move in the
> opposite direction.
> – Albert Einstein

Lists

You can use asterisks, plus symbols or hyphens as list markers for unordered lists. Example:

* Apple
* Banana
* Cherry

Ordered lists use numbers followed by periods. Example:

1. Red
2. Green
3. Blue

The actual numbers are not important for the output.

Code

Code blocks can be formatted by indenting a paragraph with 4 or more spaces (or one tab). Example:

This is a normal paragraph.

    This is a code block.

The inline preview uses a monospace font for code blocks.

Inline code is enclosed in a pair of backtick characters. Example:

You can use the `markdown` or `markdown2` modules to parse Markdown in Python.

Emphasis

Markdown uses one, two, or three asterisks (*) or underscores (_) for emphasizing text. Example:

*This is italic*
**This is bold**
***This is bold and italic***

Images

Images have the same syntax as links, except that an exclamation mark is added. Example:

![Alt text](http://example.com/image.png)

Supported Markdown Extensions

Editorial supports a couple of Markdown extensions (“dialects”) in its HTML preview, some of which are also visible directly in the editor. In the settings, you can either turn on these extensions separately, or switch to Multi-Markdown mode, which supports most of the extensions out of the box.

Footnotes

Footnotes are very similar to reference links, i.e. the definition of a footnote is usually put at the bottom of the text or section.:

This is a footnote[^1]

...Other text

[^1]: Footnote definition

Tip

If you use the default set of snippets, you can insert a footnote by typing ffn, and a footnote definition with ffd. Selecting a footnote in the editor also gives you an option to jump to the definition (Select “Go to Footnote” in the Copy/Paste menu).

Strikethrough

Similar to **bold** and *italic*, you can strike out text by surrounding it with two tilde characters on each side: ~~example~~

Superscript

Tables

The syntax for tables basically looks like ASCII art:

First Header  | Second Header | Third Header |
 ------------ | :-----------: | -----------: |
Cell          |   *Cell*      |      Cell    |
Cell          |   **Cell**    |      Cell    |

Table cells are separated by pipe (|) characters, the colons below the table headers indicate the column’s alignment. See the MultiMarkdown Syntax Guide for more details.

Smart Quotes

When enabled, straight quotation marks are automatically converted to typographic (curly) quotation marks.

Metadata Headers

To use metadata, simply add key-value pairs to the top of a Markdown file:

Title:  My Article
Author: John Doe
Date:   July 25, 2005

When the Metadata Headers option is enabled, these headers will not be visible in the HTML preview.

Folding Sections

You can quickly hide the contents of a section by tapping the triangle next to the header.

When a section is folded, the number of hidden words is shown next to it. You can quickly unfold all sections by tapping the gray triangle in the top-left corner.

The header level (number of #) determines how much is folded, e.g. folding a level-1 header also hides all level-2+ headers below it, up to the next level-1 header.

Tips

  • Some of the built-in snippets are very useful to make editing Markdown more efficient. For example, you can simply type llnk to insert a link with the cursor correctly positioned to write its title.
  • If you paste a lot of text from the clipboard, try typing ppp instead of using the standard editing menu – it can be a lot faster.
  • When you select a footnote while editing, you can jump to its definition from the editing menu (if the definition doesn’t exist yet, this is also a quick way of creating it).
  • When you have a word selected and tap the * key, the text is automatically enclosed in a pair of asterisks (which makes it italic or bold) – the same applies to parentheses.
  • While editing lists, you might find the “Arrange Paragraphs” mode useful: It allows you to move lines via drag’n’drop – you can enable this in the quick settings (“Aa” button).