Syntax

About 2 min read

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-chart and /插入图表 are equivalent. Examples below use the English form. Same goes for the data-ref keyword: ref@xxx and 引用@xxx both 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:

Named data blocks

A block that starts with @name and can be referenced by ref@:

Resolution order:

  1. Look for a @xxx of the same name in the same file.
  2. If not found, look for xxx.csv / xxx.json / xxx.md in the same directory.
  3. If still not found, error out.

Five built-in commands

/insert-table

QuarterSales
Q1100
Q2120
Q3140
Q4180

No LLM call — pure data → HTML table.

/insert-chart

需要 LLM API key — 点右上角 Settings 配一个再试

LLM turns description + data → Vega-Lite spec → interactive in-browser rendering.

/insert-flow

需要 LLM API key — 点右上角 Settings 配一个再试

LLM emits Mermaid code → rendered in the browser.

/insert-illustration

插图错误(行 76)
图像 API 失败: 需要图片生成 API key — 点右上角 Settings 配一个再试

Calls an image API (Zhipu CogView / Gemini Imagen / OpenAI gpt-image-1) and produces PNG/JPEG.

/insert-interactive

需要 LLM API key — 点右上角 Settings 配一个再试

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:

See Examples for live documents using these.

Next