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 @.

Command blocks

A triple-colon fence whose first line begins with /command-name:

::: /插入图表 引用@销售
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 引用@:

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)

No chat provider configured for lib-mode build

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

/插入流程图 (insert-flowchart)

No chat provider configured for lib-mode build

LLM emits Mermaid code → rendered in the browser.

/插入插图 (insert-illustration)

插图错误(行 74)
图像 API 失败: No image provider configured for lib-mode build

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

/插入交互 (insert-interactive)

No chat provider configured for lib-mode build

LLM picks one of 4 built-in widgets (filterable-table / tabs / slider-calc / accordion), fills in its config → rendered in the browser.

Next