Syntax
Folio is extended markdown — every bit of plain markdown still works, plus two structural primitives: command blocks ::: and named data blocks @.
Every Folio command has a Chinese canonical name AND an English alias.
/insert-chartand/插入图表are equivalent. Examples below use the English form. Same goes for the data-ref keyword:ref@xxxand引用@xxxboth work.
Command blocks
A triple-colon fence whose first line begins with /command-name:
::: /insert-chart ref@sales
Bar chart, X = quarter, Y = sales
Highlight Q4
:::
Inside the fence:
- First line:
/command [args...] ref@xxx: a special argument referencing a data block.xxxmust not contain spaces.- A single command can take multiple
ref@arguments. - Subsequent lines: natural-language body.
Named data blocks
A block that starts with @name and can be referenced by ref@:
Resolution order:
- Look for a
@xxxof the same name in the same file. - If not found, look for
xxx.csv/xxx.json/xxx.mdin the same directory. - If still not found, error out.
Five built-in commands
/insert-table
| Quarter | Sales |
|---|---|
| Q1 | 100 |
| Q2 | 120 |
| Q3 | 140 |
| Q4 | 180 |
No LLM call — pure data → HTML table.
/insert-chart
LLM turns description + data → Vega-Lite spec → interactive in-browser rendering.
/insert-flow
LLM emits Mermaid code → rendered in the browser.
/insert-illustration
图像 API 失败: 需要图片生成 API key — 点右上角 Settings 配一个再试
Calls an image API (Zhipu CogView / Gemini Imagen / OpenAI gpt-image-1) and produces PNG/JPEG.
/insert-interactive
LLM picks one of 4 built-in widgets (filterable-table / tabs / slider-calc / accordion), fills in its config → rendered in the browser.
R2 commands
R2 added four more block commands and two inline forms:
:::comparison— before-after / side-by-side / radar comparisons:::timeline— vertical or horizontal sequences==term==body syntax + frontmatternotes:dictionary → hover annotation[txt](#id)body syntax + frontmatterreferences:dictionary → citation card
See Examples for live documents using these.