Introduction to Markdown Syntax
Markdown uses simple markers to express headings, lists, emphasis and other structures. It is useful for writing and exchanging documents. Use ordinary ASCII punctuation for the markers below.
WonderPen supports some Markdown typing shortcuts: enter # followed by a space in an empty paragraph to create a heading, or type **text** to make text bold. Configure these rules in Settings → Advanced → Markdown. Typing shortcuts, pasting Markdown and importing Markdown files are different operations; not every syntax below converts automatically as you type. See Editor.
Paragraphs and Line Breaks
In Markdown source, separate paragraphs with a blank line. For a forced line break within a paragraph, end the line with two spaces before the newline. How an ordinary single newline appears depends on the app reading it.
This is the first paragraph.
This is the second paragraph.In WonderPen’s editor, press Return to create a new paragraph. The editor maintains the paragraph structure, so an extra blank line is unnecessary.
Headings
Begin a line with one to six # characters, followed by a space and the heading text:
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6Example
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Lists
Start unordered list items with - or *. For ordered lists, use a number followed by a period. Leave a space between the marker and the text.
- Item 1
- Item 2
- Item 3
1. Item 1
2. Item 2
3. Item 3Example
- Item 1
- Item 2
- Item 3
- Item 1
- Item 2
- Item 3
Quotations
Prefix a quoted paragraph with >. For multiple paragraphs, separate them with a line containing only >:
> This is the first quoted paragraph.
>
> This is the second quoted paragraph.This is the first quoted paragraph.
This is the second quoted paragraph.
Links
[Link text](URL)For example, [WonderPen](https://www.tominlab.com/wonderpen) renders as WonderPen.
Images
Image syntax resembles link syntax, with an exclamation mark at the beginning:
The path can be a URL or a path relative to the Markdown file. In WonderPen, you can also insert a local image through the editor’s image controls without writing a path.
Bold and Italic
Wrap text in two asterisks for bold, or one for italic:
**Bold**
*Italic***Bold** → Bold
*Italic* → Italic
Code
Wrap inline code in backticks: `print("Hello")` renders as print("Hello").
For multiple lines, put triple-backtick fences on separate lines around the code:
```python
print("Hello")
print("WonderPen")
```With the relevant typing rule enabled, entering three consecutive backticks in an empty paragraph outside lists and quotations in WonderPen creates a code block directly. The language name after the opening fence is Markdown source syntax; you do not need to type the complete fenced block to create one in the editor.
Strikethrough and Escaping
~~Obsolete text~~ renders as Obsolete text. This is a common extension that not every Markdown tool supports.
To display a marker literally, prefix it with a backslash: \*text\* displays as *text* rather than italic text. Inline code and code blocks are also useful for showing source syntax.
Tables
Tables are a common Markdown extension. A table has a header row, an alignment row and content rows. Colons indicate alignment:
| Left | Center | Right |
| --- | :---: | ---: |
| AAA | abc | 10 |
| BBB | 33 | 5 || Left | Center | Right |
|---|---|---|
| AAA | abc | 10 |
| BBB | 33 | 5 |
Horizontal Rules
Place three asterisks or hyphens on a line by themselves. In source files, leave a blank line before and after the rule so that --- is not interpreted as an underline for the preceding heading.
***or:
---Both produce a horizontal rule:
Using Markdown in WonderPen
You can also create tables, links and images with the editor’s insertion controls. To retain literal markers such as asterisks, use escaping, code formatting or disable the relevant Markdown typing rule. A Markdown export may look different in another app while retaining structures such as headings and lists.
