Code blocks
Use fenced code blocks when whitespace, syntax, or exact text matters.
```tsexport function title(text: string) { return text.trim();}```Lapis renders ordinary code fences in notes. Some fenced blocks also have special meaning in the app.
Lapis supports inline and block LaTeX math in notes.
Inline math: $E = mc^2$
$$\sum_{n=1}^{5} n = 15$$Mermaid diagrams
Section titled “Mermaid diagrams”Use Mermaid fences when a note needs a lightweight diagram.
```mermaidflowchart LR A[Note] --> B[Metadata cache] B --> C[Graph]```Plugin-aware fences
Section titled “Plugin-aware fences”Some plugins use fenced blocks as inputs to richer features. For example,
search can render query blocks, and notebook documents use their own cell
syntax for executable content.
Use the right tool for the job
Section titled “Use the right tool for the job”- Use ordinary code fences for source, config, commands, and snippets.
- Use math blocks when the note needs readable equations.
- Use Mermaid when a quick diagram belongs inside the note itself.
- Use notebook documents when the work needs executable cells rather than a static fenced block. Start with Getting started with notebooks.