# Markdown syntax

Each example shows what you type, then what the preview shows, rendered by
[Charon](https://charon.memomori.app), the open source renderer the app uses. In a note, switch between
**Editor**, **Split** and **Preview** with <kbd>⌘</kbd> <kbd>E</kbd>.

## Text

```md
**Bold**, *italic*, ***both*** and ~~struck~~.

==Highlighted==, ++inserted++, H~2~O and x^2^.

Use `inline code` for names and commands.
```

End a line with two spaces, or a backslash, to break it without starting a new
paragraph. Put a `\` before a character to show it as is: `\*not italic\*`.

## Headings

```md
# Title
## Section
### Subsection
```

Every heading gets an id, so you can link to it. Set your own with `{#id}`:
`## Plans {#plans}`. See [Attributes](#attributes) for more.

## Lists

```md
- Milk
- Eggs
  - Free range

1. Preheat the oven
2. Mix
3. Bake

- [x] Book the train
- [ ] Pack
```

## Quotes and rules

```md
> The hut closes at six.

---

Three dashes draw a line.
```

## Callouts

```md
> [!NOTE]
> The last train leaves at 23:40.

> [!WARNING] Cash only
> The hut takes no cards.

> [!TIP]- Click to open
> Buy water at the fifth station.
```

Start a quote with a type in brackets. Text after it becomes the title. Put
`-` after the type to fold the callout shut, or `+` to fold it but start open.
The type sets the color:

| Color  | Types                                                        |
| ------ | ------------------------------------------------------------ |
| Blue   | `note`, `info`, `todo`, `abstract`, `summary`, `tldr`        |
| Green  | `tip`, `hint`, `success`, `check`, `done`                    |
| Purple | `important`, `example`                                       |
| Amber  | `warning`, `caution`, `attention`, `question`, `help`, `faq` |
| Red    | `danger`, `error`, `failure`, `fail`, `missing`, `bug`       |
| Gray   | `quote`, `cite`                                              |

Any other type works too and shows in blue. Case doesn't matter.

## Links and images

```md
[MemoMori](https://memomori.app) or just https://memomori.app

![Mount Fuji](/docs/assets/fuji.webp){width=240}
```

`{width=…}` sets an image's width, one of the [attributes](#attributes) you can
set. To link your own notes and files, use [wikilinks](#wikilinks).

## Tables

```md
| Item  | Qty | Price |
| :---- | --: | ----: |
| Tea   |   2 |  $8   |
| Bread |   1 |  $4   |
```

Colons in the second row align a column left, right, or centered (`:---:`).

## Code blocks

````md
```ts
const greet = (name: string) => `Hello, ${name}`
```
````

Name the language after the backticks for syntax colors. Every block gets a copy
button.

## Footnotes

```md
Fuji is 3,776 m tall.[^1]

[^1]: The tallest peak in Japan.
```

## Definitions and abbreviations

```md
Markdown
: A plain text format for writing.

The HTML spec is long.

*[HTML]: HyperText Markup Language
```

Hover the abbreviation in the preview to see its full form.

## Emoji

```md
:tada: :coffee: :white_check_mark:
```

## Math

```md
Inline: $E = mc^2$

$$
\int_0^1 x^2\,dx = \frac{1}{3}
$$
```

MemoMori renders math with KaTeX. Wrap inline math in `$` and blocks in `$$`.

## Diagrams

````md
```mermaid
graph LR
  Idea --> Draft --> Note
  Draft --> Trash
```
````

A `mermaid` block draws a diagram: flowcharts, sequence, class, state and ER
diagrams, Gantt charts, pie charts, mind maps, timelines and more. See the
[Mermaid docs](https://mermaid.js.org/intro/) for each kind.

## Tables from CSV

````md
```csv
city,country,people
Tokyo,Japan,37400000
Delhi,India,32900000
```
````

A `csv` or `tsv` block draws a table, and the first row becomes the header.

## Maps

````md
```geojson
{
  "type": "Feature",
  "properties": { "name": "Tokyo to Mount Fuji" },
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [139.7671, 35.6812],
      [138.7274, 35.3606]
    ]
  }
}
```
````

A `geojson` block draws a map of its points, lines and shapes. Click a shape to
see its properties.

## Queries

Use a `query` block to list notes that match a search. Add options to sort,
group or summarize them. See [Queries](/docs/queries) for examples.

## Wikilinks

```md
See [[Trip plan]], [[Trip plan|the plan]] or [[Trip plan#Budget]].
```

| Write                     | Links to                                          |
| ------------------------- | ------------------------------------------------- |
| `[[Trip plan]]`           | The note `Trip plan.md`. Notes need no `.md`.     |
| `[[travel/Trip plan]]`    | A note in a folder.                               |
| `[[Trip plan\|the plan]]` | The same note, shown as "the plan".               |
| `[[Trip plan#Budget]]`    | A heading in that note.                           |
| `[[Trip plan#^day-one]]`  | A block you marked with `^day-one`.               |
| `[[#Budget]]`             | A heading in this note.                           |
| `[[photo.png]]`           | Any other file. Other files need their extension. |
| `[[paper.pdf#page=3]]`    | A page of a PDF.                                  |

Type `[[` and MemoMori suggests your files. To mark a block, end a paragraph
with ` ^day-one`, or put `^day-one` on its own line under a list, table or
quote. [Links and embeds](/docs/links) explains how names find files and what
happens when you rename one.

## Tags

```md
Pack for #travel, and book the #travel/japan trains.
```

Type `#` and a word to tag a note. Click a tag, or type it in
[search](/docs/search#search-by-tag), to see every note that carries it.

- Use letters, digits, `-` and `_`. A tag needs one character that is not a
  digit, so `#1` stays plain text.
- `/` nests tags: `#travel/japan` also counts as `#travel`.
- Case doesn't matter. `#Travel` and `#travel` are one tag.
- The `#` must start a word, so `issue#12` is not a tag. Put `\#` to write a
  plain `#word`.

A `tags` list in [frontmatter](#frontmatter) tags the note the same way.

## Embeds

```md
![[fuji.webp|240]]

![[Trip plan#Budget]]
```

An embed shows another file inside the note, as it is now, not a copy.

| Write                            | Shows                                                        |
| -------------------------------- | ------------------------------------------------------------ |
| `![[photo.jpg]]`                 | An image. Add `\|300` for a width or `\|640x480` for a size. |
| `![[Trip plan]]`                 | A whole note. Add `#Budget` or `#^day-one` for one part.     |
| `![[sketch.excalidraw]]`         | A drawing. Add `#Frame name` for one frame.                  |
| `![[talk.mp4]]`, `![[song.mp3]]` | A video or audio player.                                     |
| `![[paper.pdf]]`                 | A PDF reader.                                                |
| `![[novel.epub]]`                | A book. Click **Read here** to open it.                      |
| `![[walk.geojson]]`              | A map.                                                       |
| `![[script.py]]`                 | A code file, with syntax colors.                             |

Paste or drop a file into a note and MemoMori uploads it next to the note and
writes the embed for you.

### PDFs and books

```md
![[paper.pdf#page=3]]
![[paper.pdf#page=3&height=400]]
![[novel.epub#height=400]]
```

An embedded PDF shows in a box you can scroll, with its page number, find and
contents. An embedded book waits for **Read here**, since a book downloads
whole. The card above each one opens the file on its own page.

| Add           | To                                                  |
| ------------- | --------------------------------------------------- |
| `#page=3`     | Open a PDF at page 3.                               |
| `#height=400` | Set the box's height in pixels. 600 is the default. |
| `&`           | Join the two: `#page=3&height=400`.                 |

A link takes `#page=3` too: `[[paper.pdf#page=3]]` opens the PDF at that page.

## Frontmatter

```md
---
title: Trip plan
tags: [travel, 2026]
date: 2026-11-26
---
```

YAML between `---` lines at the very top of a note is its frontmatter. The
preview hides it, and the **Metadata** panel beside the note shows it, with
dates, links and tags laid out. Each entry under `tags` is a [tag](#tags): click
it in the panel to search for it.

Every other key is a property you can
[search by](/docs/search#search-by-property): `[title:trip]` or
`[date:2026-11]` finds this note. Click a key or a value in the panel to run
that search.

## HTML and video

```md
<details>
  <summary>Spoiler</summary>
  It was the butler.
</details>

![](https://youtu.be/dQw4w9WgXcQ){width=480}
```

HTML works in notes, `<iframe>` included. An image link to a YouTube video
becomes a player.

## Attributes

```md
Pack light. {style="color:tomato"}

Ask for *amazake*{lang=ja title="Sweet rice drink"} at the hut.

- Water
- Snacks
{style="color:steelblue"}

![Mount Fuji](/docs/assets/fuji.webp){width=160 style="border-radius:8px"}
```

Braces set HTML attributes on an element, without writing the HTML.

| Write              | Sets                                            |
| ------------------ | ----------------------------------------------- |
| `{#day-1}`         | The id, so `[Day one](#day-1)` links to it.     |
| `{.lead}`          | A class. Add more with spaces: `{.lead .wide}`. |
| `{width=240}`      | Any attribute.                                  |
| `{title="Hi you"}` | An attribute whose value has spaces.            |

Where you put the braces picks the element:

| Put `{…}`                                            | To set it on            |
| ---------------------------------------------------- | ----------------------- |
| At the end of a paragraph, heading or list item      | That block              |
| Right after `*text*`, `**text**`, a link or an image | That element            |
| On its own line, right under a list or quote         | The whole list or quote |
| On its own line, after a blank line under a table    | The table               |

- Leave no space before inline braces: `*word*{…}`, not `*word* {…}`.
- Braces in the middle of plain text stay as text.
- Without the blank line, braces under a table become a new row.
- Code blocks ignore attributes.
- Notes have no styles for your own classes. Use `style` to change the look.
- MemoMori strips scripts and `on…` handlers, and opens links to other sites in
  a new tab on its own, so `{target=_blank}` adds nothing.

## Comments

```md
The hut opens at six. %%Check this before we go.%%

%%
Nothing here shows in the preview.
%%
```

Text between `%%` marks stays in the note and out of the preview, on one line
or across many.

Coming from Obsidian? See [Coming from Obsidian](/docs/obsidian).
