# Markdown in Dunjii

Dunjii pages are GitHub-flavored markdown with a few additions for running a game. Each one still reads as plain text in any other editor.

## Title and subtitle

The `#` heading is the page's title. An italic line right under it becomes the subtitle.

```markdown
# Eldric Vael
*Old elf, scholar of Oghma*

Finds the undead in the temple fascinating rather than terrifying. Trails off when a new idea arrives.
```

- `*Old elf, scholar of Oghma*`: An italic line right under the title is the subtitle.

## Callouts

A blockquote whose first line is `[!callout]` becomes a box. Dunjii removes the marker line and draws the rest. A blockquote without the marker stays a quote.

```markdown
> [!callout]
> ### Locked door
> DC 15 to pick. The key hangs in the abbot's study, behind the tapestry.
```

- `> [!callout]`: The marker. It has to be the first line of the blockquote.

## Block layouts

A comment line before a list or a table changes how Dunjii draws it. Other markdown editors hide comments, so the file still reads correctly in Obsidian or on GitHub.

```markdown
<!-- block: layout=vitals -->

- **AC** 12
- **HP** 50
- **Speed** 30 ft.

<!-- block: layout=inline -->

- **Init** +2
- **Passive Perception** 13
- **CR** 6
```

- `<!-- block: layout=vitals -->`: Draws each item as a box, with the bold words as its label.
- `<!-- block: layout=inline -->`: Puts the items side by side on one line.

Add `scale=0.9` after the layout to draw the block at 90% of its size. The layouts:

| Layout | Value | Goes before | Games |
| --- | --- | --- | --- |
| Plain lines | `plain-lines` | A list | All |
| Inline list | `inline` | A list | All |
| Vitals | `vitals` | A list | All |
| Abilities (D&D 2024) | `dnd-2024-ability-grid` | A table | D&D 5e |

## Highlights and rolls

Two equals signs on each side highlight text. Dice notation such as `2d6 + 4` becomes a button that rolls it on a Dunjii page, and a highlighted bonus such as `==+6==` rolls a d20 with that bonus.

```markdown
**Arcane Burst.** ==+6== to hit, 16 (3d8 + 3) force damage.
```

- `**Arcane Burst.** ==+6== to hit, 16 (3d8 + 3) force damage.`: ==+6== is highlighted and rolls 1d20 + 6. 3d8 + 3 rolls as written.

## Links

Double brackets link to another document in your workspace by its name. A Sourcebook page links by its address.

```markdown
[[Eldric Vael]]
[[Eldric Vael#Personality|the old scholar]]
![[mistwood-map.png]]
[Fireball](https://dunjii.com/sourcebooks/dnd-srd-5.2.1/Spells/Fireball)
```

- `[[Eldric Vael]]`: The document named Eldric Vael.
- `[[Eldric Vael#Personality|the old scholar]]`: A heading in it, shown as "the old scholar".
- `![[mistwood-map.png]]`: An image from your workspace, drawn in place.
- `[Fireball](https://dunjii.com/sourcebooks/dnd-srd-5.2.1/Spells/Fireball)`: A Sourcebook page.

Moving or renaming a document in the app updates the links that point at it.

## Everything else

Tables, lists, task lists, bold, italic and images work as in any GitHub-flavored markdown. Frontmatter at the top of a file sets the document's type and its settings: see [Document types](https://dunjii.com/docs/reference/document-types.md) and [Folder settings](https://dunjii.com/docs/organizing/folder-settings.md).
