Charts and code blocks

A fenced code block (three backticks on their own lines) holds text that Return leaves exactly as you wrote it: a clause in its original wording, a snippet of a statute, a SQL query. One kind of block is different. A block tagged mermaid is drawn as a chart or diagram, from the same plain text.

Both live in the markdown file as text. Nothing about them depends on Return: the file opens in any editor.

Code blocks

```sql
SELECT * FROM invoices WHERE due < date('now');
```

Charts

A block tagged mermaid is drawn from mermaid syntax: a chart type on the first line, then its data as text.

```mermaid
pie title Cost structure
  "Materials" : 45
  "Shipping" : 25
  "Marketing" : 30
```

Insert one with the + at the caret or with /chart (also /pie, /bar, /gantt), then pick the type. Return inserts a minimal scaffold with the title selected, so the first thing you type is the title; replace the sample labels and numbers with your own. The types on offer:

TypeForSyntax
Pieshares of a wholepie, one "Label" : value per slice
Bar, Linecomparing values, trendsxychart-beta with x-axis, y-axis and a bar [...] or line [...] series
Timelineschedules and deadlinesgantt, tasks as Name :id, start date, duration
Flowa process or a decisionflowchart TD, nodes joined with -->

Anything else mermaid can draw (sequence diagrams, mind maps, and more) works the same way; type it into a mermaid block by hand.

What to know