Skip to content

Markdown Formatting

The editor is a markdown source editor, not a preview, so you always see the actual characters in your file. Syntax highlighting is mostly just dimming markers like ** so they don’t distract from the words you’re writing, and subtly styling some elements so documents are easier to scan. Common edits have the keyboard shortcuts you’d expect (see Keyboard Shortcuts).

Headings are all rendered the same, regardless of level. When there’s room, hash-style heading markers “hang” in the left margin so the text stays aligned with the body copy. Heading colour is one of the few configurable preferences because it can hugely improve scannability when working with long documents.

# Heading 1
## Heading 2
### Heading 3

You can transform the current line into a heading with the same shortcuts as in Notion.

ShortcutAction
Option + Command + 1 Alt + Control + 1 Option + Command + 1 Option + Command + 4 Alt + Control + 4 Option + Command + 4 Set the line to a Heading 1–4
Option + Command + 0 Alt + Control + 0 Option + Command + 0 Remove the heading (back to a paragraph)

Wrap text in ** for bold and * for italic. You can use Command + B Control + B Command + B and Command + I Control + I Command + I as you’d expect.

this is **bold** and this is *italic*

Ordered and unordered lists work as you’d expect in a markdown editor, and you can indent/outdent with Command + Left Square Bracket Control + Left Square Bracket Command + Left Square Bracket and Command + Right Square Bracket Control + Right Square Bracket Command + Right Square Bracket .

- First item
- Second item
 
1. First step
2. Second step

Markdown links are highlighted like this:

[Astro Editor](https://astroeditor.danny.is)

You can use Command + K Control + K Command + K to wrap selected text in an empty markdown link or insert one at the cursor. Pasting a valid URL over selected text will wrap it in a link to that URL.

Holding Option Alt Option while clicking a URL will open it in your browser.

To link to another item in your content collections, use the Content Finder.

Markdown images are shown like links.

![Picture of a cat](https://astroeditor.danny.is/cat.jpg)

Holding Option Alt Option while hovering will show a small preview.

Inline code (using backticks) and fenced code blocks are shown in a monospace font with a background to differentiate them from non-code. Code is deliberately not syntax-highlighted (see Philosophy).

Use the `glob()` loader in your config.
 
```ts
const articles = defineCollection({ /* ... */ })
```

Blockquotes are shown in grey, italicised.

> A quote stands out from the surrounding text.