# Markdown

Live preview, reading view, references that know git, Obsidian syntax, and Mermaid.


Rip treats Markdown as a first-class file type. The preview renders while you type, follows your cursor, and knows about your repository.

## Preview

Press <kbd>secondary-shift-m</kbd> to open the preview beside the editor. It renders again after each edit and scrolls to follow the cursor. When the preview has focus, <kbd>up</kbd>, <kbd>down</kbd>, <kbd>pageup</kbd>, and <kbd>pagedown</kbd> scroll it. Set `markdown-preview = "split"` to open every Markdown file with the preview.

## Reading view

Press <kbd>secondary-alt-v</kbd>, and the tab itself becomes the rendered page. Press it again to edit. Set `markdown-preview = "reading"` to open notes this way.

## What renders

Rip renders GitHub Flavored Markdown: tables, task lists, and footnotes. Code fences get syntax highlighting in the editor and in the preview. [File types](/docs/file-types.md) lists the fence names. A fence with `file=path lines=a-b` renders those lines from the file on disk. A document can quote code that stays current.

Mermaid diagrams render as diagrams: flowcharts, state diagrams, sequence diagrams, and pie charts.

## References that know git

Mention a commit like `e08ba37` or a pull request like `#12` anywhere in a document. The preview turns it into a link with its status: merged, open, draft, or not found. On a task item, the chip also shows the title. Check a box in the preview, and Rip edits the source line.

## Obsidian syntax

Rip understands the syntax that Obsidian notes use:

- `[[wikilinks]]` resolve to files anywhere in the folder.
- `> [!tip]` and the other callout types render as callouts.
- `==highlights==` render as highlighted text.
- `#tags` render as tags.
- `%%comments%%` stay out of the preview.
- `![[image.png]]` embeds the image.

## The plan

Press <kbd>secondary-alt-p</kbd> to open your plan beside the code. Press it again from the plan to go back. Rip opens the file that `plan-file` names. Without that setting, it looks for `docs/ROADMAP.md`, `ROADMAP.md`, `docs/PLAN.md`, `PLAN.md`, and then `TODO.md`.

## Keys

| Keys | What happens |
| --- | --- |
| <kbd>secondary-shift-m</kbd> | Open or close the preview. |
| <kbd>secondary-alt-v</kbd> | Switch between the editor and the reading view. |
| <kbd>secondary-alt-p</kbd> | Open the plan, or return from it. |

## Settings

| Key | What it changes |
| --- | --- |
| `markdown-preview` | How a Markdown file opens: `"split"`, `"reading"`, or `"off"`. |
| `plan-file` | The document that <kbd>secondary-alt-p</kbd> opens. |
