Skip to content

Markdown Syntax

Lokus uses a markdown compiler built on markdown-it with extensions for highlights, strikethrough, task lists, math, callouts, and WikiLinks.

SyntaxOutputNotes
**bold**boldAlso supports __bold__
*italic*italicAlso supports _italic_
~~strikethrough~~strikethroughRequires markdown-it-strikethrough-alt
==highlight==Highlighted textRequires markdown-it-mark
`inline code`inline codeSingle backticks
<u>underline</u>Underlined textHTML tags enabled
SyntaxLevel
# HeadingH1
## HeadingH2
### HeadingH3
#### HeadingH4
##### HeadingH5
###### HeadingH6

A space after # is required. Maximum depth: 6 levels.

Enable in Preferences > Markdown to use a custom marker (default ^):

SyntaxLevel
^ HeadingH1
^^ HeadingH2
^^^ HeadingH3
[Link text](https://example.com)
[Link with title](https://example.com "Title")
[[Note Name]]
[[Note Name|Display Text]]

WikiLinks create bidirectional connections visible in the Graph View. Toggle WikiLink support in Preferences > Markdown.

URLs are automatically converted to clickable links when linkify is enabled (on by default).

https://example.com
![Alt text](path/to/image.png)
![Alt text](https://example.com/image.jpg "Optional title")

WikiLink-style images are also supported:

![[image.png]]
- Item one
- Item two
- Nested item

Valid markers: -, *, +. Default: -.

1. First item
2. Second item
3. Third item
- [ ] Incomplete task
- [x] Complete task
- [/] Partially complete task

Task checkboxes are interactive in the editor — click to toggle state.

> Single blockquote
> Nested blockquotes
>> Second level
>>> Third level

Callouts use Obsidian-compatible syntax:

> [!note] Optional Title
> Callout content here.
TypeDescription
[!note]General information
[!tip]Helpful advice
[!warning]Caution notice
[!danger]Critical warning
[!info]Informational
[!success]Success message
[!question]Question or FAQ
[!example]Example content

Collapsible callouts use a - suffix:

> [!tip]- Click to expand
> Hidden content here.
```javascript
const greeting = "Hello, Lokus!";
console.log(greeting);
```

Language identifiers are supported for syntax highlighting. The alternative ~~~ fence marker also works.

Use `inline code` in a sentence.
| Header 1 | Header 2 | Header 3 |
|----------|:--------:|---------:|
| Left | Center | Right |
| Cell | Cell | Cell |
AlignmentSyntax
Left (default):-- or ---
Center:-:
Right--:

Tables pasted from spreadsheets are automatically detected and formatted.

The equation $E = mc^2$ is well-known.
$$
\int_{a}^{b} f(x) \, dx = F(b) - F(a)
$$

Insert inline math with Cmd+M / Ctrl+M. Insert math blocks with Cmd+Shift+M / Ctrl+Shift+M.

Any of these produce a horizontal rule:

---
***
___

Minimum 3 characters required.

Inline HTML is supported because the compiler runs with html: true:

<details>
<summary>Click to expand</summary>
Hidden content here.
</details>
Text with <mark>HTML highlight</mark> or <kbd>keyboard</kbd> styling.

Prefix any markdown character with \ to render it literally:

\*not italic\*
\# not a heading
\[[not a wikilink]]

The markdown compiler accepts these options (configured in source):

OptionDefaultDescription
htmltrueAllow HTML tags in markdown
linkifytrueAuto-convert URLs to links
typographertrueSmart quotes and dashes
breakstrueConvert newlines to <br>
aggressivetrueAggressively detect markdown in pasted content
minLength5Minimum text length for markdown detection

Per-workspace syntax settings are stored in .lokus/markdown-syntax.json. Configure which features are enabled in Preferences > Markdown.

FeatureConfig KeyDefault
WikiLinkslink.wikiLink.enabledtrue
Task ListstaskList.enabledtrue
Tablestable.enabledtrue
Strikethroughstrikethrough.enabledtrue
Highlighthighlight.enabledtrue
Inline Mathmath.inline.enabledtrue
Block Mathmath.block.enabledtrue
Auto-link URLslink.autoLink.enabledtrue
Imagesimage.enabledtrue
Comments (%%)comments.enabledfalse
Footnotesfootnote.enabledfalse