diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6de2df1..0f74b79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,10 +45,17 @@ marqdo ext add web # CDN → 2.0.0
### Added
+- **文件级新语义迁移**:`marqdo migrate labels --mark` 可把整个库/目录迁移到显式 `markup: occlusion`,即使文件没有旧式索引也不再依赖进程默认值。迁移验证为语法级、无导入解析依赖,并在写入前比较 Classic 与 Occlusion AST 形状。
+- **显式过渡入口**:`marqdo run --legacy-markup` 与 `marqdo check --legacy-markup` 可在一个版本周期内审阅未迁移的旧文件;环境变量不再改变语法。
+
### Fixed
+- 标准库、扩展库、示例、公开文档与可解析测试夹具迁移为文件级 Occlusion;旧的 `[键](集合)` 和 `- [项](集合)` 分别改为 `access` 与 `遍历`。
+
### Changed
+- 未标注源码默认采用 Occlusion。Classic 仅能通过明确的 frontmatter 或 `--legacy-markup` 进入,避免同一文档因进程配置而静默改变含义。
+
## v1.5.2 — 2026-10-18
### Highlights
diff --git a/README.md b/README.md
index aee02c2..c37eef3 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件,
| **知识-代码一致性**
Knowledge-Code Coherence | 说明、数据、示例与实现**同一份源文件**:文档里的表格就是程序的数据,文档里的调用就是真实执行。「文档过期」不再是悄悄漂移,而是可被机器发现的**知识不一致**——知识陈述本身可以被测试。 |
| **默认安全,AI 友好** | 无标记文字默认是叙述(注释),只有显式标记才进入执行。AI 自由发挥**不会污染**文档与代码的边界——这比「自然语言编程」安全得多,是 AI 原生语言的重要前提。 |
| **multi-view artifact**
`.mq.md` 双后缀即开放接口 | `.mq` 告诉解释器「可执行」,`.md` 告诉整个 Markdown 生态「仍是文档」。GitHub 直接读、VS Code 直接改、搜索引擎直接索引、LLM 直接理解、Marqdo 直接运行。**Marqdo 不占有知识,只是给 Markdown 增加执行语义。** |
-| **表格即数据结构** | 程序的数据结构直接就是文档的数据结构:单列竖表 → `List`;横表(1 数据行)→ `Map`;横表(多数据行)→ `Map` of `List`(列向聚合);首列写 `@` / `行` / `row` → 行向记录 `List` of `Map`。取元 `[键](集合)` 也是 Markdown 链接形。这是 literate programming 的下一步。 |
+| **表格即数据结构** | 程序的数据结构直接就是文档的数据结构:单列竖表 → `List`;横表(1 数据行)→ `Map`;横表(多数据行)→ `Map` of `List`(列向聚合);首列写 `@` / `行` / `row` → 行向记录 `List` of `Map`。取元使用 `access(集合, "键")`,链接 `[描述](表达式)` 只承载叙述与执行体。这是 literate programming 的下一步。 |
| **语义干净** | **返回是架构,打印只是函数**:`*…*` 改变控制流,`print` 只是副作用函数;分支与循环长在 Markdown 结构上(`1.` `2.` 递增 = 分支,`-` = 循环),不是所有列表都被粗暴当成 if。 |
| **AI 的可靠上下文与长期记忆** | 一个 `.mq.md` 同时是 documentation + schema + code + examples + knowledge + executable behavior;AI 不必再拼装 README + OpenAPI + JSON Schema + prompt。整个工程天然就是 AI 的**世界模型**——比 RAG 更接近 Executable RAG。 |
| **链接即调用**
Link as Call | 文档里的 `[描述](类.函数)` 不是装饰,是跨文档类调用;编译器解析类/函数并返回 **LinkInfo**,`view` 显示调用点,EKC 建边,`links.lock` 可选复现。**v2.1 设计目标**;v2.0.0 已具备本地表达式链接与 `import` + 实例调用。 |
@@ -151,7 +151,7 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件,
|------|------|
| 无标记行 | 叙述(注释);行内 `` `名` `` 可声明 |
| `**…**` | **代码**(赋值 / 调用 / 表达式) |
-| `[描述](表达式)` | **链接(本地)**:描述 + 代码;`()` 与 `**…**` 同权(v2.0.0 需 `markup: occlusion`) |
+| `[描述](表达式)` | **链接(本地)**:描述 + 代码;`()` 与 `**…**` 同权(默认语义) |
| `[描述](类.函数)` | **链接(跨文档/类调用)**:描述 + 已有类函数调用;可解析、可执行(v2.1 目标) |
| `[描述](url)` | 普通 Markdown 导航链接(惰性,不执行) |
| `*…*` | **返回值**(整行、`返回*n*`、或表达式形) |
@@ -163,11 +163,11 @@ Marqdo 把 Markdown **标记当作编程语法**:同一个 `.mq.md` 文件,
| `` > `obj`.method … `` | 方法调用(`obj` 为带 `_type` 的 map) |
| 叙述 `` `名` `` / `` `名`=默认 `` | 形参由体推断(`` + `名` `` 仍可用) |
| `1.` … | 体内 `1.` `2.` … = 分支(`N. *` = else) |
-| `-` | 循环(`` - `条件` `` 或 `` - [项](集合) ``) |
-| 表格 | 集合(几何即类型,见下);取元优先 `[键](集合)` |
+| `-` | 循环(`` - `条件` `` 或 `` - [项](遍历 集合 为 项) ``) |
+| 表格 | 集合(几何即类型,见下);取元使用 `access(集合, "键")` |
| 单独一行 `---` / `***` | **叙述分隔**(跳过;不是函数收束) |
-> `[键](集合)` / `- [项](集合)` 是旧取元/循环形;v2 链接语法推荐 `[描述](表达式)` / `[描述](类.函数)` / `- [描述](遍历 集合 为 项)`。旧形在 Classic 下保留,见 [link-syntax.md](doc/design/link-syntax.md)。
+> `[键](集合)` / `- [项](集合)` 是旧取元/循环形;迁移后使用 `access(集合, "键")` 与 `- [描述](遍历 集合 为 项)`。旧形只在显式 `markup: classic` 或 `--legacy-markup` 过渡入口中保留,见 [link-syntax.md](doc/design/link-syntax.md)。
```markdown
# main
diff --git a/doc/next/Marqdo_Executable_Knowledge_Development.md b/doc/next/Marqdo_Executable_Knowledge_Development.md
index ae5eecb..f131247 100644
--- a/doc/next/Marqdo_Executable_Knowledge_Development.md
+++ b/doc/next/Marqdo_Executable_Knowledge_Development.md
@@ -1066,8 +1066,8 @@ View 至少展示:
| 阶段 | 默认行为 | 兼容行为 |
|---|---|---|
-| 2.0.x | Classic 默认,Occlusion opt-in | 当前行为 |
-| 2.1 preview | 新语义可显式开启;迁移报告必开 | Classic 发 deprecated warning |
+| 2.0.x | Classic 默认,Occlusion opt-in | 历史行为 |
+| 2.1 preview | 新语义默认;全仓语料具有文件级 `markup: occlusion` | `--legacy-markup` / 显式 `markup: classic` 只读过渡 |
| 2.1 stable | 新语义默认;旧形状必须已迁移 | `--legacy-markup` 只读运行一个周期 |
| 2.2 | 删除全局模式与旧 parser 分支 | 仅保留明确错误和迁移建议 |
@@ -1085,7 +1085,7 @@ View 至少展示:
### 16.3 必须显式变化的能力
-- `[键](集合)` 迁为 `at`;
+- `[键](集合)` 迁为 `access(集合, "键")`;
- 链接不再依赖进程级 markup 模式;
- `类.函数` 对无 receiver 函数成为合法 AssociatedFunction 调用;
- 正文知识链接被解析和诊断,但不自动执行;
diff --git a/examples/agent-okf-flywheel/index.mq.md b/examples/agent-okf-flywheel/index.mq.md
index 1bfcce8..3e965e2 100644
--- a/examples/agent-okf-flywheel/index.mq.md
+++ b/examples/agent-okf-flywheel/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: agent-okf-flywheel (Wave B0)
description: Promote solidified workbook; second plan is cache=hit — document as knowledge base (OKF).
import:
diff --git a/examples/agent-pong/index.mq.md b/examples/agent-pong/index.mq.md
index 1111fc7..35c6be7 100644
--- a/examples/agent-pong/index.mq.md
+++ b/examples/agent-pong/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: agent-pong (Wave B0)
description: >-
Constitution demo — call_site + source in step context; optional live CALL via .env.
diff --git a/examples/agent-sandbox-okf/index.mq.md b/examples/agent-sandbox-okf/index.mq.md
index a96280e..744c1dd 100644
--- a/examples/agent-sandbox-okf/index.mq.md
+++ b/examples/agent-sandbox-okf/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: agent-sandbox-okf — trial then commit
description: >
O1 example: opt-in sandbox trial with GFM-table returns and link-index reads.
@@ -20,8 +21,8 @@ Short demo: write via `agent.trial`, prove the host is clean until commit.
> fs.make_dir path="_example_sbx"
**dry = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=False**
-**dry_ok = [ok](dry)**
-**dry_committed = [committed](dry)**
+**dry_ok = [ok](access(dry, "ok"))**
+**dry_committed = [committed](access(dry, "committed"))**
1. `dry_ok`
1. not `dry_committed`
> print text=dry-ok
@@ -37,8 +38,8 @@ Short demo: write via `agent.trial`, prove the host is clean until commit.
> print text=host-clean
**wet = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=True**
-**wet_ok = [ok](wet)**
-**wet_committed = [committed](wet)**
+**wet_ok = [ok](access(wet, "ok"))**
+**wet_committed = [committed](access(wet, "committed"))**
1. `wet_ok`
1. `wet_committed`
> print text=wet-ok
@@ -53,7 +54,7 @@ Short demo: write via `agent.trial`, prove the host is clean until commit.
2. *
> print text=proof-missing
-**pname = [name]([profile](wet))**
+**pname = [name](access([profile](access(wet, "profile")), "name"))**
1. `pname` == "default"
> print text=profile-default
2. *
diff --git a/examples/anlian-mq/components/chrome.mq.md b/examples/anlian-mq/components/chrome.mq.md
index b0acad0..75768bc 100644
--- a/examples/anlian-mq/components/chrome.mq.md
+++ b/examples/anlian-mq/components/chrome.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/chrome
description: 暗恋见君壳层 — head 资源表、导航 HTML、页脚 HTML(对齐 Django base / site_footer)。
---
diff --git a/examples/anlian-mq/components/foot.mq.md b/examples/anlian-mq/components/foot.mq.md
index 62f4131..866e7e7 100644
--- a/examples/anlian-mq/components/foot.mq.md
+++ b/examples/anlian-mq/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 页脚
站点信息与站长链接(毛玻璃底由壳样式绘制)。
diff --git a/examples/anlian-mq/components/fragments.mq.md b/examples/anlian-mq/components/fragments.mq.md
index be83076..d91ae0a 100644
--- a/examples/anlian-mq/components/fragments.mq.md
+++ b/examples/anlian-mq/components/fragments.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/fragments
description: AJAX 片段 — /post/ten、/news/five。
导入:
diff --git a/examples/anlian-mq/components/hero.mq.md b/examples/anlian-mq/components/hero.mq.md
index eff9384..1c21f38 100644
--- a/examples/anlian-mq/components/hero.mq.md
+++ b/examples/anlian-mq/components/hero.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 首页引言
英雄区 HTML(品牌标语 + CTA + 漂浮主图)。样式在 `styles/shell` 的 Hero / 动效表。
diff --git a/examples/anlian-mq/components/home_body.mq.md b/examples/anlian-mq/components/home_body.mq.md
index e2e7611..6c5090d 100644
--- a/examples/anlian-mq/components/home_body.mq.md
+++ b/examples/anlian-mq/components/home_body.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/home_body
description: 首页主体 HTML — hero + 公告 + 新闻时间线 + 论坛帖子(对齐 Django home.html,无外层导航)。
导入:
@@ -20,9 +21,9 @@ description: 首页主体 HTML — hero + 公告 + 新闻时间线 + 论坛帖
**帖子行 = > 库.查询 表="posts" 上限=10 排序="-created_at"**
**公告段 = None**
-- [告](公告行)
- **文 = [content](告)**
- **时 = [created_at](告)**
+- [告](遍历 公告行 为 告)
+ **文 = [content](access(告, "content"))**
+ **时 = [created_at](access(告, "created_at"))**
**一项 = "
"**
**公告段 = > table.append list=公告段 item=一项**
1. 公告段
diff --git a/examples/anlian-mq/components/nav.mq.md b/examples/anlian-mq/components/nav.mq.md
index ff0dbff..bc5c50c 100644
--- a/examples/anlian-mq/components/nav.mq.md
+++ b/examples/anlian-mq/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 导航
顶栏:首页、帖子、新闻、搜索、聊天、发帖(登录后)、后台。
diff --git a/examples/anlian-mq/components/page.mq.md b/examples/anlian-mq/components/page.mq.md
index 9e56855..aed9915 100644
--- a/examples/anlian-mq/components/page.mq.md
+++ b/examples/anlian-mq/components/page.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/page
description: 用原站 chrome 包一层完整 HTML 引言(bare 布局)。
import:
diff --git a/examples/anlian-mq/db/index.mq.md b/examples/anlian-mq/db/index.mq.md
index df47ea0..ae4b665 100644
--- a/examples/anlian-mq/db/index.mq.md
+++ b/examples/anlian-mq/db/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: db/index
description: 打开库、建全表、幂等种子、帖子全文索引。
导入:
diff --git a/examples/anlian-mq/db/schema.mq.md b/examples/anlian-mq/db/schema.mq.md
index 50d730a..b4b6f5b 100644
--- a/examples/anlian-mq/db/schema.mq.md
+++ b/examples/anlian-mq/db/schema.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## posts
帖子主表。`slug` 用于详情路径;`board` 为板块显示名,`board_id` 关联 `boards`。
diff --git a/examples/anlian-mq/db/seed.mq.md b/examples/anlian-mq/db/seed.mq.md
index c74c61d..af9ad39 100644
--- a/examples/anlian-mq/db/seed.mq.md
+++ b/examples/anlian-mq/db/seed.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## boards
帖子板块:日常 / 开发 / 聊天。
diff --git a/examples/anlian-mq/index.mq.md b/examples/anlian-mq/index.mq.md
index 4da3277..df66b49 100644
--- a/examples/anlian-mq/index.mq.md
+++ b/examples/anlian-mq/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 暗恋见君 · Marqdo
description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表详情、发帖门禁、聊天室、专题、搜索、API 指南。
导入:
@@ -141,10 +142,10 @@ description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表
**房间行 = > store.查询 表="chat_rooms" 上限=50**
**房间段 = None**
-- [房](房间行)
- **名 = [name](房)**
- **链 = [slug](房)**
- **摘 = [summary](房)**
+- [房](遍历 房间行 为 房)
+ **名 = [name](access(房, "name"))**
+ **链 = [slug](access(房, "slug"))**
+ **摘 = [summary](access(房, "summary"))**
**项 = "" + 摘 + "
"**
**房间段 = > table.append list=房间段 item=项**
**房间内 = > text.str_join xs=房间段 sep=""**
@@ -165,10 +166,10 @@ description: 对齐 Django 暗恋见君:原站 CSS/DOM、首页四段、列表
**专题行 = > store.查询 表="topics" 上限=50**
**专题段 = None**
-- [题](专题行)
- **题名 = [title](题)**
- **链 = [slug](题)**
- **摘 = [summary](题)**
+- [题](遍历 专题行 为 题)
+ **题名 = [title](access(题, "title"))**
+ **链 = [slug](access(题, "slug"))**
+ **摘 = [summary](access(题, "summary"))**
**项 = "" + 题名 + "
" + 摘 + "
slug: " + 链 + "
"**
**专题段 = > table.append list=专题段 item=项**
**专题内 = > text.str_join xs=专题段 sep=""**
diff --git a/examples/anlian-mq/offline-smoke.mq.md b/examples/anlian-mq/offline-smoke.mq.md
index def8026..220de64 100644
--- a/examples/anlian-mq/offline-smoke.mq.md
+++ b/examples/anlian-mq/offline-smoke.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: anlian-mq offline smoke
description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读路径可构造。
导入:
@@ -45,7 +46,7 @@ description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读
**应用 = > 应用.门禁 路径="/write" 角色="admin" 匹配="prefix" 拒绝="redirect"**
**应用 = > 应用.路由实时 路径="/chat/ws" 模式="broadcast"**
-**gates = [gates](应用)**
+**gates = [gates](access(应用, "gates"))**
**n = > len value=`gates`**
1. `n` >= 2
> print text=gates-ok
@@ -53,9 +54,9 @@ description: 不 listen:装配库表/页面/门禁/WS 路由袋,验证可读
> print text=gates-fail
> sys.exit code=1
-**ws = [ws_routes](应用)**
-**room = [/chat/ws](ws)**
-**mode = [mode](room)**
+**ws = [ws_routes](access(应用, "ws_routes"))**
+**room = [/chat/ws](access(ws, "/chat/ws"))**
+**mode = [mode](access(room, "mode"))**
1. `mode` == "broadcast"
> print text=ws-ok
2. *
diff --git a/examples/anlian-mq/styles/shell.mq.md b/examples/anlian-mq/styles/shell.mq.md
index 653857f..8247f0e 100644
--- a/examples/anlian-mq/styles/shell.mq.md
+++ b/examples/anlian-mq/styles/shell.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: styles/shell
description: 暗恋见君壳样式——对照 Django 原站粉玻璃 + 动效,用表格声明。
导入:
diff --git a/examples/browser-hello/counter.mq.md b/examples/browser-hello/counter.mq.md
index f3d63ed..c624eb9 100644
--- a/examples/browser-hello/counter.mq.md
+++ b/examples/browser-hello/counter.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: browser counter (C3)
description: wire table + browser.set_text — no json glue
import:
diff --git a/examples/browser-hello/fetch.mq.md b/examples/browser-hello/fetch.mq.md
index a053a6b..dd98c42 100644
--- a/examples/browser-hello/fetch.mq.md
+++ b/examples/browser-hello/fetch.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: browser fetch (C4)
description: fetch/after effects via lib/browser — no json glue
import:
diff --git a/examples/browser-hello/form.mq.md b/examples/browser-hello/form.mq.md
index 8d81b22..63aa108 100644
--- a/examples/browser-hello/form.mq.md
+++ b/examples/browser-hello/form.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: browser form (D3)
description: input wire passes value; effects via lib/browser
import:
diff --git a/examples/browser-media/media.mq.md b/examples/browser-media/media.mq.md
index 9aecf39..87a3532 100644
--- a/examples/browser-media/media.mq.md
+++ b/examples/browser-media/media.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: browser-media (route F)
description: file / canvas / audio / observers / drag — GFM tables + lib/browser
import:
diff --git a/examples/engineering-knowledge/config/resolve.mq.md b/examples/engineering-knowledge/config/resolve.mq.md
index 07cea27..7b24860 100644
--- a/examples/engineering-knowledge/config/resolve.mq.md
+++ b/examples/engineering-knowledge/config/resolve.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: resolve_config
capability: config.resolve
status: stable
diff --git a/examples/engineering-knowledge/index.mq.md b/examples/engineering-knowledge/index.mq.md
index 2bd54f3..bf43629 100644
--- a/examples/engineering-knowledge/index.mq.md
+++ b/examples/engineering-knowledge/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Engineering Knowledge demo
description: Tiny project demonstrating Capability Catalog + reuse + decisions.
---
diff --git a/examples/executable-knowledge/docs/invoice-answer.mq.md b/examples/executable-knowledge/docs/invoice-answer.mq.md
index ded309e..933e70d 100644
--- a/examples/executable-knowledge/docs/invoice-answer.mq.md
+++ b/examples/executable-knowledge/docs/invoice-answer.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
id: document.invoice-answer
type: Answer
import:
@@ -7,7 +8,7 @@ import:
# 发票回答
-**总额 = [订单的含税总价](pricing.订单定价.含税总额(订单))**
+**总额 = [订单的含税总价](access(pricing.订单定价.含税总额(订单), "订单的含税总价"))**
这张订单的含税总额是[含税总价](总额)。
diff --git a/examples/executable-knowledge/schema/order.mq.md b/examples/executable-knowledge/schema/order.mq.md
index b6fcc57..61a98ed 100644
--- a/examples/executable-knowledge/schema/order.mq.md
+++ b/examples/executable-knowledge/schema/order.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
id: schema.order
type: Schema
---
diff --git a/examples/knowledge-layers/libai.mq.md b/examples/knowledge-layers/libai.mq.md
index aedb728..982ae9e 100644
--- a/examples/knowledge-layers/libai.mq.md
+++ b/examples/knowledge-layers/libai.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: Fact
id: libai
title: 李白
diff --git a/examples/knowledge-layers/main.compat.mq.md b/examples/knowledge-layers/main.compat.mq.md
index 818a55e..2cea87c 100644
--- a/examples/knowledge-layers/main.compat.mq.md
+++ b/examples/knowledge-layers/main.compat.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
import:
libai: libai.mq.md
---
diff --git a/examples/knowledge-layers/main.mq.md b/examples/knowledge-layers/main.mq.md
index 859010b..c3cc8ae 100644
--- a/examples/knowledge-layers/main.mq.md
+++ b/examples/knowledge-layers/main.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
# main
诗人李白的出生年份是[出生年份](李白.出生年份)。
diff --git a/examples/knowledge-layers/poet.mq.md b/examples/knowledge-layers/poet.mq.md
index d5a78b4..3eead98 100644
--- a/examples/knowledge-layers/poet.mq.md
+++ b/examples/knowledge-layers/poet.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
# 诗人
| 字段 | 类型 | 说明 |
diff --git a/examples/linalg-least-squares/index.mq.md b/examples/linalg-least-squares/index.mq.md
index 339a3cc..eb32adb 100644
--- a/examples/linalg-least-squares/index.mq.md
+++ b/examples/linalg-least-squares/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Least squares via lstsq
description: Overdetermined Ax≈b with ext/linalg lstsq + heatmap.
import:
@@ -28,8 +29,8 @@ $$
**`_` = > la.draw factor=`A` kind="heatmap" theme="light" path="ls-heatmap.svg"**
**`ls` = > la.lstsq a=`A` b=`b`**
-**`x` = [x](ls)**
-**`resid` = [residual_fro](ls)**
+**`x` = [x](access(ls, "x"))**
+**`resid` = [residual_fro](access(ls, "residual_fro"))**
> print text=`x`
> print text=`resid`
diff --git a/examples/linalg-svd/index.mq.md b/examples/linalg-svd/index.mq.md
index 0051463..42a36e5 100644
--- a/examples/linalg-svd/index.mq.md
+++ b/examples/linalg-svd/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: SVD structure demo
description: Diagonal SVD + structure SVG via ext/linalg.
import:
@@ -18,7 +19,7 @@ $$
**`M` = > la.from_formula formula=`M`**
**`f` = > la.factorize matrix=`M` kind="svd"**
-**`S` = [S](f)**
+**`S` = [S](access(f, "S"))**
**`_` = > la.draw factor=`f` kind="svd" theme="light" path="svd-structure.svg"**
**`hm` = > la.draw factor=`M` kind="hinton" path="svd-hinton.svg"**
diff --git a/examples/linalg-transpose/index.mq.md b/examples/linalg-transpose/index.mq.md
index 0864f25..b598eab 100644
--- a/examples/linalg-transpose/index.mq.md
+++ b/examples/linalg-transpose/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Transpose identity (formula document)
description: (AB)^T = B^T A^T as a runnable lecture fragment.
import:
@@ -19,8 +20,8 @@ Declare shapes in a table, form \(P = AB\), then check \((AB)^\top = B^\top A^\t
| 2 | B | 3 | 2 |
**`env` = > la.declare table=`shapes`**
-**`A` = [A](env)**
-**`B` = [B](env)**
+**`A` = [A](access(env, "A"))**
+**`B` = [B](access(env, "B"))**
**`P` = `A` * `B`**
**`t` = > `P`.T_ascii**
> print text=`t`
diff --git a/examples/link-syntax/libai.mq.md b/examples/link-syntax/libai.mq.md
index 8e6efae..d647918 100644
--- a/examples/link-syntax/libai.mq.md
+++ b/examples/link-syntax/libai.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: Fact
id: libai
title: 李白
diff --git a/examples/link-syntax/main.mq.md b/examples/link-syntax/main.mq.md
index ae490df..0ff2200 100644
--- a/examples/link-syntax/main.mq.md
+++ b/examples/link-syntax/main.mq.md
@@ -1,2 +1,6 @@
+---
+markup: occlusion
+---
+
# main
用户想要知道李白的出生年份,我们要告诉用户[李白的出生年份](李白.李白的出生年份)
diff --git a/examples/marqdo-blog/api/echo.mq.md b/examples/marqdo-blog/api/echo.mq.md
index 7348d76..1b75fa3 100644
--- a/examples/marqdo-blog/api/echo.mq.md
+++ b/examples/marqdo-blog/api/echo.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: endpoint
method: POST
path: /api/echo
diff --git a/examples/marqdo-blog/api/ping.mq.md b/examples/marqdo-blog/api/ping.mq.md
index c6f824d..42dfff1 100644
--- a/examples/marqdo-blog/api/ping.mq.md
+++ b/examples/marqdo-blog/api/ping.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: endpoint
method: GET
path: /api/ping
diff --git a/examples/marqdo-blog/components/foot.mq.md b/examples/marqdo-blog/components/foot.mq.md
index 877eb3c..3ecf33a 100644
--- a/examples/marqdo-blog/components/foot.mq.md
+++ b/examples/marqdo-blog/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 页脚
站点页脚。放版权与概览链接。
diff --git a/examples/marqdo-blog/components/nav.mq.md b/examples/marqdo-blog/components/nav.mq.md
index b41153f..c67b75f 100644
--- a/examples/marqdo-blog/components/nav.mq.md
+++ b/examples/marqdo-blog/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 导航
站点顶部导航。首项是站点名(渐变 Logo 由主题 CSS 处理),`后台` 指向需要登录的 `/admin`。
diff --git a/examples/marqdo-blog/components/side.mq.md b/examples/marqdo-blog/components/side.mq.md
index b43d879..07cf43c 100644
--- a/examples/marqdo-blog/components/side.mq.md
+++ b/examples/marqdo-blog/components/side.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 侧栏
右侧归档面板:文章入口、标签、实时小部件。
diff --git a/examples/marqdo-blog/db/posts.mq.md b/examples/marqdo-blog/db/posts.mq.md
index a5a3ba2..2c6e1ed 100644
--- a/examples/marqdo-blog/db/posts.mq.md
+++ b/examples/marqdo-blog/db/posts.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: blog posts schema
import:
data: ext/data/db.mq.md
diff --git a/examples/marqdo-blog/db/schema.mq.md b/examples/marqdo-blog/db/schema.mq.md
index 2ad6403..5c3899c 100644
--- a/examples/marqdo-blog/db/schema.mq.md
+++ b/examples/marqdo-blog/db/schema.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## posts
文章主表结构。`slug` 用于详情页 `/post/{slug}` 的动态路由;`content` 存 Markdown 正文;`tag` 是主标签(tags 表 slug)。
diff --git a/examples/marqdo-blog/db/seed.mq.md b/examples/marqdo-blog/db/seed.mq.md
index 55de21c..225f95f 100644
--- a/examples/marqdo-blog/db/seed.mq.md
+++ b/examples/marqdo-blog/db/seed.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## posts
种子文章。首页与详情页的初始数据。created_at 用于按时间倒序展示;tag 是主标签 slug。
diff --git a/examples/marqdo-blog/index.mq.md b/examples/marqdo-blog/index.mq.md
index c622fb1..3ad7bee 100644
--- a/examples/marqdo-blog/index.mq.md
+++ b/examples/marqdo-blog/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: web
title: Marqdo 博客
route: /
diff --git a/examples/marqdo-blog/pages/about.mq.md b/examples/marqdo-blog/pages/about.mq.md
index fd50dd6..848830a 100644
--- a/examples/marqdo-blog/pages/about.mq.md
+++ b/examples/marqdo-blog/pages/about.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
类型: 网页
路由: /about
方法: GET
diff --git a/examples/marqdo-blog/pages/post.mq.md b/examples/marqdo-blog/pages/post.mq.md
index 4a9cdef..91d09d0 100644
--- a/examples/marqdo-blog/pages/post.mq.md
+++ b/examples/marqdo-blog/pages/post.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: web
title: Post
route: /post/{slug}
diff --git a/examples/marqdo-blog/serve.mq.md b/examples/marqdo-blog/serve.mq.md
index f7e6f64..cbfed36 100644
--- a/examples/marqdo-blog/serve.mq.md
+++ b/examples/marqdo-blog/serve.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: marqdo-blog serve
description: Scan Artifact documents/endpoints and listen (ADR 0007).
import:
diff --git a/examples/marqdo-blog/styles/theme.mq.md b/examples/marqdo-blog/styles/theme.mq.md
index 863d746..4d8f5f6 100644
--- a/examples/marqdo-blog/styles/theme.mq.md
+++ b/examples/marqdo-blog/styles/theme.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: styles/theme
description: 博客主题:样式即数据表格,装配即函数。
import:
diff --git a/examples/oa2026-showcase/add.mq.md b/examples/oa2026-showcase/add.mq.md
index 7519d39..a5d4b7b 100644
--- a/examples/oa2026-showcase/add.mq.md
+++ b/examples/oa2026-showcase/add.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 加一
对于输入变量`n`,我们执行 **`n` = `n` + 1**,然后把更新后的值作为结果返回 *`n`*。
diff --git a/examples/oa2026-showcase/bell.mq.md b/examples/oa2026-showcase/bell.mq.md
index 278b9ad..b308d33 100644
--- a/examples/oa2026-showcase/bell.mq.md
+++ b/examples/oa2026-showcase/bell.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 贝尔态:两个量子比特如何一起回答
description: 从一条假设开始,搭电路、看概率、画图,并用断言验收。
import:
@@ -31,8 +32,8 @@ import:
我们期待什么?如果假设成立,`概率`应该只在「00」与「11」上有值,而且各占一半。
先把两个关键概率取出来,读者不必在长映射里找:
-**`p00` = [00](概率)**
-**`p11` = [11](概率)**
+**`p00` = [00](access(概率, "00"))**
+**`p11` = [11](access(概率, "11"))**
> print text=`p00`
> print text=`p11`
diff --git a/examples/oa2026-showcase/calculus.mq.md b/examples/oa2026-showcase/calculus.mq.md
index 9d6ea65..6f09933 100644
--- a/examples/oa2026-showcase/calculus.mq.md
+++ b/examples/oa2026-showcase/calculus.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 一份可执行的求导讲义
description: 公式、求导、求根、求值与绘图,在同一条叙述里完成。
import:
diff --git a/examples/quantum-bell/index.mq.md b/examples/quantum-bell/index.mq.md
index e6c4b93..69eeb16 100644
--- a/examples/quantum-bell/index.mq.md
+++ b/examples/quantum-bell/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Bell state
description: H then CX; probabilities ≈ 1/2; circuit SVG.
import:
diff --git a/examples/quantum-entanglement/index.mq.md b/examples/quantum-entanglement/index.mq.md
index b1d6411..c020da3 100644
--- a/examples/quantum-entanglement/index.mq.md
+++ b/examples/quantum-entanglement/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Entanglement lab
description: Bell state — density, partial trace, Schmidt, themed SVG (Q7/Q8).
import:
@@ -31,7 +32,7 @@ Build |Φ⁺⟩ with H then CX. Full-state purity stays 1; tracing out one qubit
**ezz = > `qc`.expect obs=`zz`**
**sch = > `qc`.schmidt cut=1**
-**ent = [entropy](sch)**
+**ent = [entropy](access(sch, "entropy"))**
**_ = > `qc`.draw path="entangle-circuit.svg" theme="dark"**
**_ = > `qc`.draw kind="hinton" path="entangle-hinton.svg"**
diff --git a/examples/quantum-ghz/index.mq.md b/examples/quantum-ghz/index.mq.md
index 4eb3c82..7b5d023 100644
--- a/examples/quantum-ghz/index.mq.md
+++ b/examples/quantum-ghz/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: GHZ state
description: 3-qubit GHZ; |000⟩/|111⟩ ≈ 1/2; probs + H matrix heatmap.
import:
diff --git a/examples/web-client-site/index.mq.md b/examples/web-client-site/index.mq.md
index 71a4d30..f284088 100644
--- a/examples/web-client-site/index.mq.md
+++ b/examples/web-client-site/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
type: web
title: Marqdo client site
route: /
diff --git a/examples/web-client-site/serve.mq.md b/examples/web-client-site/serve.mq.md
index b518a9f..1736a9e 100644
--- a/examples/web-client-site/serve.mq.md
+++ b/examples/web-client-site/serve.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-client-site serve
import:
web: ext/web/web.mq.md
diff --git a/examples/web-client-site/static/client.mq.md b/examples/web-client-site/static/client.mq.md
index fe87215..929618f 100644
--- a/examples/web-client-site/static/client.mq.md
+++ b/examples/web-client-site/static/client.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: client counter (route D)
description: wired by client_embed auto-mount; GFM + lib/browser
import:
diff --git a/examples/web-collab-doc/index.mq.md b/examples/web-collab-doc/index.mq.md
index fb1a756..c90e9fc 100644
--- a/examples/web-collab-doc/index.mq.md
+++ b/examples/web-collab-doc/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-collab-doc
description: Two-browser collaborative plain-text editor over WS room (LWW snapshot sync)
import:
diff --git a/examples/web-collab-doc/static/client.mq.md b/examples/web-collab-doc/static/client.mq.md
index f2e4481..816348f 100644
--- a/examples/web-collab-doc/static/client.mq.md
+++ b/examples/web-collab-doc/static/client.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: collab client
description: LWW text sync over WS room + presence (DOC\\t protocol)
import:
diff --git a/examples/web-net-site-zh/components/foot.mq.md b/examples/web-net-site-zh/components/foot.mq.md
index 6d65a2d..b176732 100644
--- a/examples/web-net-site-zh/components/foot.mq.md
+++ b/examples/web-net-site-zh/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 页脚
`页脚` =
diff --git a/examples/web-net-site-zh/components/nav.mq.md b/examples/web-net-site-zh/components/nav.mq.md
index ef97d93..d03b57a 100644
--- a/examples/web-net-site-zh/components/nav.mq.md
+++ b/examples/web-net-site-zh/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 导航
站点顶部导航。`后台` 指向需要登录的 `/admin`。
diff --git a/examples/web-net-site-zh/components/side.mq.md b/examples/web-net-site-zh/components/side.mq.md
index 0b83f3a..2cd0971 100644
--- a/examples/web-net-site-zh/components/side.mq.md
+++ b/examples/web-net-site-zh/components/side.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 侧栏
本示例展示了哪些特性。
diff --git a/examples/web-net-site-zh/db/articles.mq.md b/examples/web-net-site-zh/db/articles.mq.md
index b8b6ae7..7beebcf 100644
--- a/examples/web-net-site-zh/db/articles.mq.md
+++ b/examples/web-net-site-zh/db/articles.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 结构
`字段` =
diff --git a/examples/web-net-site-zh/db/index.mq.md b/examples/web-net-site-zh/db/index.mq.md
index e1af68d..1b4c189 100644
--- a/examples/web-net-site-zh/db/index.mq.md
+++ b/examples/web-net-site-zh/db/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: db/index
description: 打开 sqlite、建表、幂等种子。
导入:
diff --git a/examples/web-net-site-zh/index.mq.md b/examples/web-net-site-zh/index.mq.md
index b7b56c4..120e732 100644
--- a/examples/web-net-site-zh/index.mq.md
+++ b/examples/web-net-site-zh/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 网络扩展站(中文)
description: 首页 + /about + /new(表单)+ /tools(lib/net)+ /admin(登录鉴权)+ /live(WebSocket)。
导入:
@@ -56,18 +57,18 @@ description: 首页 + /about + /new(表单)+ /tools(lib/net)+ /admin(
**解析请求 = > net.解析Cookie 内容="session=abc123; theme=dark"**
-**请求块 = [1](解析请求)**
+**请求块 = [1](access(解析请求, "1"))**
**解析响应 = > net.解析Cookie 内容="id=42; Path=/; HttpOnly; SameSite=Lax" 是响应头=True**
-**响应块 = [1](解析响应)**
+**响应块 = [1](access(解析响应, "1"))**
`边界` = ----b
`正文` = "--`边界`\nContent-Disposition: form-data; name=\"title\"\n\n你好\n--`边界`\nContent-Disposition: form-data; name=\"封面\"; filename=\"pic.png\"\nContent-Type: image/png\n\n<字节>\n--`边界`--\n"
**多部分 = > net.解析多部分 正文=`正文` 边界=`边界`**
-**字段块 = [1](多部分)**
-**文件块 = [2](多部分)**
+**字段块 = [1](access(多部分, "1"))**
+**文件块 = [2](access(多部分, "2"))**
`工具段` =
diff --git a/examples/web-net-site-zh/styles/shell.mq.md b/examples/web-net-site-zh/styles/shell.mq.md
index 791e491..ea8d88a 100644
--- a/examples/web-net-site-zh/styles/shell.mq.md
+++ b/examples/web-net-site-zh/styles/shell.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## 顶栏
`顶栏` =
diff --git a/examples/web-net-site/components/foot.mq.md b/examples/web-net-site/components/foot.mq.md
index 3fd1df0..5cf5167 100644
--- a/examples/web-net-site/components/foot.mq.md
+++ b/examples/web-net-site/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## foot
`foot` =
diff --git a/examples/web-net-site/components/nav.mq.md b/examples/web-net-site/components/nav.mq.md
index 4bd502a..fda9f11 100644
--- a/examples/web-net-site/components/nav.mq.md
+++ b/examples/web-net-site/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## nav
Site top navigation. The Admin tab points at the login-gated admin page.
diff --git a/examples/web-net-site/components/side.mq.md b/examples/web-net-site/components/side.mq.md
index c14038f..d294b80 100644
--- a/examples/web-net-site/components/side.mq.md
+++ b/examples/web-net-site/components/side.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## side
Sidebar index of what this example demonstrates.
diff --git a/examples/web-net-site/db/articles.mq.md b/examples/web-net-site/db/articles.mq.md
index d0da7bb..5484078 100644
--- a/examples/web-net-site/db/articles.mq.md
+++ b/examples/web-net-site/db/articles.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## schema
`fields` =
diff --git a/examples/web-net-site/db/index.mq.md b/examples/web-net-site/db/index.mq.md
index 80b4209..74eb540 100644
--- a/examples/web-net-site/db/index.mq.md
+++ b/examples/web-net-site/db/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: db/index
description: Open sqlite, init articles, seed once.
import:
diff --git a/examples/web-net-site/index.mq.md b/examples/web-net-site/index.mq.md
index 7eceec5..df40a1d 100644
--- a/examples/web-net-site/index.mq.md
+++ b/examples/web-net-site/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-net-site
description: Home + /about + /new (form) + /tools (net lib) + /admin (auth) + /live (WebSocket).
import:
@@ -47,12 +48,12 @@ About page: same shell.
Parse a `Cookie` request header with the standard library.
**parsed_req = > net.cookie_parse text="session=abc123; theme=dark"**
-**req_cookie = [1](parsed_req)**
+**req_cookie = [1](access(parsed_req, "1"))**
Parse a `Set-Cookie` response header.
**parsed_resp = > net.cookie_parse text="id=42; Path=/; HttpOnly; SameSite=Lax" is_response=True**
-**resp_cookie = [1](parsed_resp)**
+**resp_cookie = [1](access(parsed_resp, "1"))**
Parse a `multipart/form-data` body.
@@ -61,8 +62,8 @@ Parse a `multipart/form-data` body.
`_body` = "--`_b`\nContent-Disposition: form-data; name=\"title\"\n\nHello\n--`_b`\nContent-Disposition: form-data; name=\"cover\"; filename=\"pic.png\"\nContent-Type: image/png\n\n\n--`_b`--\n"
**mp = > net.multipart_parse body=`_body` boundary=`_b`**
-**mp_title = [1](mp)**
-**mp_cover = [2](mp)**
+**mp_title = [1](access(mp, "1"))**
+**mp_cover = [2](access(mp, "2"))**
Build the tools page as one HTML intro (intro is served raw).
diff --git a/examples/web-net-site/styles/shell.mq.md b/examples/web-net-site/styles/shell.mq.md
index 83bc026..5a665b8 100644
--- a/examples/web-net-site/styles/shell.mq.md
+++ b/examples/web-net-site/styles/shell.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## topnav
`topnav` =
diff --git a/examples/web-site-zh/components/desk.mq.md b/examples/web-site-zh/components/desk.mq.md
index 5413714..5b220ef 100644
--- a/examples/web-site-zh/components/desk.mq.md
+++ b/examples/web-site-zh/components/desk.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/desk
description: 管理台壳 — 顶栏品牌为「后台」,无前台侧栏。
---
diff --git a/examples/web-site-zh/components/foot.mq.md b/examples/web-site-zh/components/foot.mq.md
index 9b8e39b..db15bd8 100644
--- a/examples/web-site-zh/components/foot.mq.md
+++ b/examples/web-site-zh/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## foot
`foot` =
diff --git a/examples/web-site-zh/components/nav.mq.md b/examples/web-site-zh/components/nav.mq.md
index 46dc894..6bd8ecc 100644
--- a/examples/web-site-zh/components/nav.mq.md
+++ b/examples/web-site-zh/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## nav
顶栏:**登录**(访客)/ **后台** + **退出**(已登录)。
diff --git a/examples/web-site-zh/components/side.mq.md b/examples/web-site-zh/components/side.mq.md
index 29a96e6..b6bdf78 100644
--- a/examples/web-site-zh/components/side.mq.md
+++ b/examples/web-site-zh/components/side.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## side
`side` =
diff --git a/examples/web-site-zh/db/articles.mq.md b/examples/web-site-zh/db/articles.mq.md
index 6619d2e..6c063b3 100644
--- a/examples/web-site-zh/db/articles.mq.md
+++ b/examples/web-site-zh/db/articles.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## schema
`fields` =
diff --git a/examples/web-site-zh/db/index.mq.md b/examples/web-site-zh/db/index.mq.md
index e8a0121..60f7971 100644
--- a/examples/web-site-zh/db/index.mq.md
+++ b/examples/web-site-zh/db/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: db/index
description: 打开 sqlite、建表、幂等种子。
导入:
diff --git a/examples/web-site-zh/index.mq.md b/examples/web-site-zh/index.mq.md
index 5d3dee4..f52884e 100644
--- a/examples/web-site-zh/index.mq.md
+++ b/examples/web-site-zh/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中文站点示例
description: >-
与 examples/web-site 对等的 WWW Demo 样站:表驱动全站;作者业务 JS=0;作者 .css=0。
diff --git a/examples/web-site-zh/styles/shell.mq.md b/examples/web-site-zh/styles/shell.mq.md
index b9512e5..0342f1a 100644
--- a/examples/web-site-zh/styles/shell.mq.md
+++ b/examples/web-site-zh/styles/shell.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: styles/shell
description: >-
Literary dark theme for examples/web-site — ink / wine / gold after the
diff --git a/examples/web-site/components/desk.mq.md b/examples/web-site/components/desk.mq.md
index e21f59c..ef726b0 100644
--- a/examples/web-site/components/desk.mq.md
+++ b/examples/web-site/components/desk.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: components/desk
description: Admin desk chrome — brand reads Admin; no public side rail.
---
diff --git a/examples/web-site/components/foot.mq.md b/examples/web-site/components/foot.mq.md
index 8cb6d3a..442c67e 100644
--- a/examples/web-site/components/foot.mq.md
+++ b/examples/web-site/components/foot.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## foot
`foot` =
diff --git a/examples/web-site/components/nav.mq.md b/examples/web-site/components/nav.mq.md
index 92461b7..39c199d 100644
--- a/examples/web-site/components/nav.mq.md
+++ b/examples/web-site/components/nav.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## nav
Brand first, then demo routes. Guest sees **Login**; signed-in sees **Admin** + **Logout**.
diff --git a/examples/web-site/components/side.mq.md b/examples/web-site/components/side.mq.md
index 5321ff7..fdbcf78 100644
--- a/examples/web-site/components/side.mq.md
+++ b/examples/web-site/components/side.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## side
Hands-on demo checklist (links only — no JS).
diff --git a/examples/web-site/db/articles.mq.md b/examples/web-site/db/articles.mq.md
index adec292..89788b8 100644
--- a/examples/web-site/db/articles.mq.md
+++ b/examples/web-site/db/articles.mq.md
@@ -1,3 +1,7 @@
+---
+markup: occlusion
+---
+
## schema
`fields` =
diff --git a/examples/web-site/db/index.mq.md b/examples/web-site/db/index.mq.md
index d56deb8..3b5731e 100644
--- a/examples/web-site/db/index.mq.md
+++ b/examples/web-site/db/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: db/index
description: Open sqlite, init articles, seed once.
import:
diff --git a/examples/web-site/index.mq.md b/examples/web-site/index.mq.md
index 2045b01..f837f8a 100644
--- a/examples/web-site/index.mq.md
+++ b/examples/web-site/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-site
description: >-
WWW Demo sample — GFM tables for shell, schema, forms, styles, and admin.
diff --git a/examples/web-site/styles/shell.mq.md b/examples/web-site/styles/shell.mq.md
index 2ecbec7..a37d333 100644
--- a/examples/web-site/styles/shell.mq.md
+++ b/examples/web-site/styles/shell.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: styles/shell
description: >-
Literary dark theme for examples/web-site — ink / wine / gold after the
diff --git a/examples/web-spa-app/index.mq.md b/examples/web-spa-app/index.mq.md
index bc60a68..7c9856a 100644
--- a/examples/web-spa-app/index.mq.md
+++ b/examples/web-spa-app/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-spa-app
description: Native Marqdo SPA — list/detail/edit via WASM client routes + memory store
import:
diff --git a/examples/web-tenant-saas/index.mq.md b/examples/web-tenant-saas/index.mq.md
index b846c8e..fedb4c8 100644
--- a/examples/web-tenant-saas/index.mq.md
+++ b/examples/web-tenant-saas/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-tenant-saas demo
description: Dual-tenant isolation via ?t= query + tenant_scope JSON API.
import:
diff --git a/examples/web-ws-room/index.mq.md b/examples/web-ws-room/index.mq.md
index 0449f41..9ea9768 100644
--- a/examples/web-ws-room/index.mq.md
+++ b/examples/web-ws-room/index.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: web-ws-room demo
description: Dynamic room WS with presence (G-WS1/2 bag). Open / and connect via bridge or wscat.
import:
diff --git a/ext/ai/agent.mq.md b/ext/ai/agent.mq.md
index 0973755..cfcab6c 100644
--- a/ext/ai/agent.mq.md
+++ b/ext/ai/agent.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/agent
description: Document-driven agent v2 — step / plan / run; Skill Compilation via ABI plugin (episodes → learn → llm_free).
import:
@@ -139,7 +140,7 @@ Find a human-readable call line: `CALL:` or `调用:` / `调用: split value=`text` sep=`nl`**
**found = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
**t = > trim value=`line`**
**parts = > split value=`t` sep=":"**
**n = > len value=`parts`**
@@ -245,7 +246,7 @@ Structured observation for the parent developer-agent: source, named writeback s
**last_ok = None**
**last_error = None**
-- [`slot`](`slots`)
+- [slot](遍历 `slots` 为 `slot`)
**k = > json.get value=`slot` key="key"**
**body = > json.get value=`slot` key="body"**
1. `k` == "ok"
@@ -407,7 +408,7 @@ With `sandbox=True`, run via `## trial` first (commit on ok); host unchanged unt
**acc = > table.empty_list**
**chars = 0**
**count = 0**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
1. `count` < `max_lines`
**ln = > len value=`line`**
**next = chars + ln**
@@ -441,7 +442,7 @@ With `sandbox=True`, run via `## trial` first (commit on ok); host unchanged unt
**acc = > table.empty_list**
**i = 0**
**chars = 0**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
1. `i` >= `start`
**ln = > len value=`line`**
**next = chars + ln**
@@ -468,7 +469,7 @@ Drop `` blocks (including marqdo-out bodies) so parent excerpts stay
**lines = > split value=`raw` sep=`nl`**
**acc = > table.empty_list**
**skip = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
1. `skip`
**end_parts = > split value=`line` sep="-->"**
**en = > len value=`end_parts`**
@@ -719,7 +720,7 @@ Parse `ARGS:{…}` JSON line, or a bare `{…}` line after CALL.
**text = > trim value=`reply`**
**lines = > split value=`text` sep=`nl`**
**found = None**
- - [`line`](`lines`)
+ - [line](遍历 `lines` 为 `line`)
1. `found`
**_ = 1**
2. *
@@ -909,7 +910,7 @@ Parse READ:source|stderr|stdout|slots|skill (Chinese: 读取:…).
**text = > trim value=`reply`**
**lines = > split value=`text` sep=`nl`**
**found = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
**t = > trim value=`line`**
**parts = > split value=`t` sep=":"**
**n = > len value=`parts`**
@@ -1005,7 +1006,7 @@ Parse NAME: id plus a triple-angle body after CALL:scratch_tool_write.
**name = None**
**body_lines = > table.empty_list**
**in_body = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
1. `in_body`
**t = > trim value=`line`**
1. `t` == `close`
@@ -1231,7 +1232,7 @@ Bounded observation for the parent prompt (actionable, short).
**slots_brief = > table.empty_list**
1. `obs_slots`
- - [`slot`](`obs_slots`)
+ - [slot](遍历 `obs_slots` 为 `slot`)
**sk = > json.get value=`slot` key="key"**
**sl = > json.get value=`slot` key="line"**
**sb = > json.get value=`slot` key="body"**
@@ -1296,7 +1297,7 @@ First matching DECISION / 决定 line wins (ignore later conflicting decisions i
**lines = > split value=`text` sep=`nl`**
**found = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
1. `found`
**_ = 1**
2. *
@@ -1368,7 +1369,7 @@ Parse `SLUG: …` / `标识:…` after a soft-match REUSE decision.
**lines = > split value=`text` sep=`nl`**
**found = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
**t = > trim value=`line`**
**parts = > split value=`t` sep=":"**
**n = > len value=`parts`**
@@ -1420,7 +1421,7 @@ Short parent prompt: REUSE+SLUG or NEW only. Candidates may include lexical `sco
**st = > json.get value=`esc` key="st"**
**lf = > json.get value=`esc` key="lf"**
**lines = > table.empty_list**
-- [`t`](`tasks`)
+- [t](遍历 `tasks` 为 `t`)
**slug = > json.get value=`t` key="slug"**
**title = > json.get value=`t` key="title"**
**row = slug + sep + title**
@@ -1469,7 +1470,7 @@ First `SUMMARY:` / `汇总:` / `汇总:` line body, else trimmed reply.
**lines = > split value=`text` sep=`nl`**
**found = None**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
**t = > trim value=`line`**
**parts = > split value=`t` sep=":"**
**n = > len value=`parts`**
@@ -1793,7 +1794,7 @@ Always append a `decision` event. SSE publish only when `stream=True`.
Bubble parent `complete stream=True` reasoning/deltas (and errors) into the plan event list. Skip nested `done` so plan owns the final `done`. Always merge into `events` when present; `stream` reserved for callers that also SSE-publish upstream.
-- [`ev`](`from`)
+- [ev](遍历 `from` 为 `ev`)
**t = > json.get value=`ev` key="type"**
1. `t` == delta
**events = > table.append list=`events` item=`ev`**
diff --git a/ext/ai/llm.mq.md b/ext/ai/llm.mq.md
index 392d5a8..a5e5272 100644
--- a/ext/ai/llm.mq.md
+++ b/ext/ai/llm.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/llm
description: >-
Marqdo LLM intelligence primitive — ask / stream / collect / named handles.
@@ -26,7 +27,7 @@ Collapse a stream event list to final answer text (`done.result` or `error.messa
**answer = ""**
-- [ev](events)
+- [ev](遍历 events 为 ev)
**t = > json.get value=`ev` key="type"**
1. `t` == "done"
**answer = > json.get value=`ev` key="result"**
@@ -357,7 +358,7 @@ Semantic stream: return the event list (use `llm.collect` to reduce to text). Om
Transport pack via `ext/ai/llm/openai` (Ollama uses the same OpenAI-compatible path). Non-stream → `{text,usage,finish}`; stream → `{events}`.
-*> openai.chat_completions base_url=[base_url](self) api_key=[api_key](self) model=[model](self) prompt=`prompt` stream=`stream` echo=`echo` suffix=[suffix](self) bearer=[bearer](self)*
+*> openai.chat_completions base_url=[base_url](access(self, "base_url")) api_key=[api_key](access(self, "api_key")) model=[model](access(self, "model")) prompt=`prompt` stream=`stream` echo=`echo` suffix=[suffix](access(self, "suffix")) bearer=[bearer](access(self, "bearer"))*
## complete
+ `prompt`
diff --git a/ext/ai/llm/ollama.mq.md b/ext/ai/llm/ollama.mq.md
index 18cf1f3..7778331 100644
--- a/ext/ai/llm/ollama.mq.md
+++ b/ext/ai/llm/ollama.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/llm/ollama
description: >-
Ollama backend defaults. Transport reuses openai-compatible /v1 chat completions.
diff --git a/ext/ai/policies/step-route.mq.md b/ext/ai/policies/step-route.mq.md
index defe152..6db848c 100644
--- a/ext/ai/policies/step-route.mq.md
+++ b/ext/ai/policies/step-route.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: step-route policy (O3)
description: >
Table-driven map from step class → Adaptive Routing backend.
diff --git a/ext/ai/大模型.mq.md b/ext/ai/大模型.mq.md
index 86cca78..82563cf 100644
--- a/ext/ai/大模型.mq.md
+++ b/ext/ai/大模型.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/大模型
description: >-
Marqdo 大模型智能原语 — 提问 / 流式 / 收集 / 命名句柄。
@@ -21,15 +22,15 @@ description: >-
**answer = ""**
-- [ev](事件)
- **t = [type](ev)**
+- [ev](遍历 事件 为 ev)
+ **t = [type](access(ev, "type"))**
1. `t` == "done"
- **answer = [result](ev)**
+ **answer = [result](access(ev, "result"))**
2. `t` == "error"
- **answer = [message](ev)**
+ **answer = [message](access(ev, "message"))**
3. `t` == "delta"
4. `t` == "text"
- **chunk = [text](ev)**
+ **chunk = [text](access(ev, "text"))**
1. `chunk`
**answer = answer + chunk**
2. *
@@ -142,7 +143,7 @@ description: >-
**m = > 创建 模型=`模型` 基址=`基址` 密钥=`密钥`**
**r = > m.提问 提示=`p`**
-*[text](r)*
+*[text](access(r, "text"))*
# 大模型
+ `模型`=None
@@ -243,10 +244,10 @@ description: >-
表单元格会遮蔽 `自` / 列名,先取出字段再组结果表。
-**mdl = [model](自)**
-**b = [backend](自)**
-**nm = [name](自)**
-**tt = [total_tokens](usage)**
+**mdl = [model](access(自, "model"))**
+**b = [backend](access(自, "backend"))**
+**nm = [name](access(自, "name"))**
+**tt = [total_tokens](access(usage, "total_tokens"))**
`result` =
@@ -276,7 +277,7 @@ description: >-
+ `流式`=False
+ `打印增量`=False
-*> openai.chat_completions base_url=[base_url](自) api_key=[api_key](自) model=[model](自) prompt=`提示` stream=`流式` echo=`打印增量` suffix=[suffix](自) bearer=[bearer](自)*
+*> openai.chat_completions base_url=[base_url](access(自, "base_url")) api_key=[api_key](access(自, "api_key")) model=[model](access(自, "model")) prompt=`提示` stream=`流式` echo=`打印增量` suffix=[suffix](access(自, "suffix")) bearer=[bearer](access(自, "bearer"))*
## 运行
+ `提示`
@@ -285,10 +286,10 @@ description: >-
1. `流式`
**pack = > 自.完整结果 提示=`提示` 流式=True 打印增量=`打印增量`**
- *[events](pack)*
+ *[events](access(pack, "events"))*
2. *
**pack = > 自.完整结果 提示=`提示` 流式=False 打印增量=`打印增量`**
- *[text](pack)*
+ *[text](access(pack, "text"))*
## 聊天
+ `提示`
diff --git a/ext/ai/智能体.mq.md b/ext/ai/智能体.mq.md
index 1a856f7..ec468ed 100644
--- a/ext/ai/智能体.mq.md
+++ b/ext/ai/智能体.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/智能体
description: 文档驱动智能体 v2 — 单步 / 多步 / 运行;技能编译经 ABI v2 agent 插件(情景 → 学习 → llm_free)。
导入:
@@ -38,7 +39,7 @@ description: 文档驱动智能体 v2 — 单步 / 多步 / 运行;技能编
**lines = > split value=`text` sep=`nl`**
**found = 空**
-- [`line`](`lines`)
+- [line](遍历 `lines` 为 `line`)
**t = > trim value=`line`**
**parts = > split value=`t` sep=:**
**n = > len value=`parts`**
diff --git a/ext/ai/沙盒.mq.md b/ext/ai/沙盒.mq.md
index 5f434c8..45f9bac 100644
--- a/ext/ai/沙盒.mq.md
+++ b/ext/ai/沙盒.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/ai/沙盒
description: >-
AI 试跑 CoW 工作区:打开 / 运行 / 差异 / 提交(中文面,委托英文 sandbox 模块)。
diff --git a/ext/linalg/linalg.mq.md b/ext/linalg/linalg.mq.md
index 1aa3a0e..b0aeeef 100644
--- a/ext/linalg/linalg.mq.md
+++ b/ext/linalg/linalg.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/linalg/linalg
description: Formula-first linear algebra (English). MatExpr simplify + display; ABI plugin.
import:
diff --git a/ext/linalg/线性代数.mq.md b/ext/linalg/线性代数.mq.md
index d8747d4..a61c632 100644
--- a/ext/linalg/线性代数.mq.md
+++ b/ext/linalg/线性代数.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/linalg/线性代数
description: 公式优先的线性代数(中文)。矩阵表达式化简与展示;ABI 插件。
import:
diff --git a/ext/net/http.mq.md b/ext/net/http.mq.md
index 2500e61..36cf1ad 100644
--- a/ext/net/http.mq.md
+++ b/ext/net/http.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/net/http
description: HTTP primitives surface for Web Runtime (ADR 0007). Prefer Document/Endpoint Artifacts over raw calls.
import:
diff --git a/ext/net/url.mq.md b/ext/net/url.mq.md
index 8e555f9..fe4dfec 100644
--- a/ext/net/url.mq.md
+++ b/ext/net/url.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/net/url
description: URL helpers (stdlib wrappers). ADR 0007.
import:
diff --git a/ext/quantum/quantum.mq.md b/ext/quantum/quantum.mq.md
index d3c8232..292bb99 100644
--- a/ext/quantum/quantum.mq.md
+++ b/ext/quantum/quantum.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/quantum/quantum
description: Official quantum circuit simulator (English). Gates + circuits; ABI plugin.
import:
diff --git a/ext/quantum/量子.mq.md b/ext/quantum/量子.mq.md
index f471ce6..ae11768 100644
--- a/ext/quantum/量子.mq.md
+++ b/ext/quantum/量子.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/quantum/量子
description: 官方量子电路模拟(中文)。门 + 电路;ABI 插件。
import:
diff --git a/ext/security/oidc.mq.md b/ext/security/oidc.mq.md
index f06a15c..8864ae3 100644
--- a/ext/security/oidc.mq.md
+++ b/ext/security/oidc.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/security/oidc
description: OIDC attach helper for app handles (ADR 0007). Prefer declared auth metadata on Endpoints.
import:
diff --git a/ext/security/rbac.mq.md b/ext/security/rbac.mq.md
index a9ed2f3..6e0a732 100644
--- a/ext/security/rbac.mq.md
+++ b/ext/security/rbac.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/security/rbac
description: RBAC Resource (ADR 0007).
import:
diff --git a/ext/web/_capability.mq.md b/ext/web/_capability.mq.md
index 5a99d13..617f2cd 100644
--- a/ext/web/_capability.mq.md
+++ b/ext/web/_capability.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/_capability
description: Internal — load native web plugin once. Authors must not call this; import web = capability (ADR 0007).
import:
diff --git a/ext/web/client.mq.md b/ext/web/client.mq.md
index d0da3bd..c0245b1 100644
--- a/ext/web/client.mq.md
+++ b/ext/web/client.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/client
description: Browser Runtime helpers (WASM bridge). Prefer lib/browser for effect tables (ADR 0007).
import:
diff --git a/ext/web/component.mq.md b/ext/web/component.mq.md
index 1e78926..e80203c 100644
--- a/ext/web/component.mq.md
+++ b/ext/web/component.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/component
description: Reusable Document fragments as View node tables (ADR 0007).
import:
diff --git a/ext/web/dom.mq.md b/ext/web/dom.mq.md
index e39c65e..aef8237 100644
--- a/ext/web/dom.mq.md
+++ b/ext/web/dom.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/dom
description: DOM Artifact — Markdown/body to structure; raw HTML is escape hatch only (ADR 0007).
import:
@@ -30,10 +31,10 @@ Escape hatch — wrap a raw HTML string. Prefer Markdown / View nodes.
Render a DOM Artifact (markdown or raw) to HTML via native plugin.
> cap.load
-**kind = [kind](dom)**
+**kind = [kind](access(dom, "kind"))**
1. `kind` == "raw"
- **html = [html](dom)**
+ **html = [html](access(dom, "html"))**
*html*
2. *
- **text = [text](dom)**
+ **text = [text](access(dom, "text"))**
*> web_dom_markdown text=`text`*
diff --git a/ext/web/page.mq.md b/ext/web/page.mq.md
index 7954ef7..d3c1383 100644
--- a/ext/web/page.mq.md
+++ b/ext/web/page.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/page
description: Document → View. Sole compose path is render(nodes=) with unified View schema (ADR 0007).
import:
@@ -37,13 +38,13 @@ Render Document to HTML. `nodes` is the unified View table; when omitted, uses `
> cap.load
**n = nodes**
1. `n` == None
- **n = [nodes](self)**
+ **n = [nodes](access(self, "nodes"))**
2. *
**_ = 1**
1. `n`
*> web_render_nodes page=`self` nodes=`n` db=`db`*
2. *
- **body = [body](self)**
+ **body = [body](access(self, "body"))**
*> web_render_document page=`self` body=`body` db=`db`*
## css
diff --git a/ext/web/route.mq.md b/ext/web/route.mq.md
index 6215d48..b782f45 100644
--- a/ext/web/route.mq.md
+++ b/ext/web/route.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/route
description: Declared Endpoint / Document route registration (ADR 0007).
import:
@@ -43,19 +44,19 @@ Register this declared route on an app handle.
> cap.load
**a = app**
1. `a` == None
- **a = [app](self)**
+ **a = [app](access(self, "app"))**
2. *
**_ = 1**
-**page = [page](self)**
-**fn = [fn](self)**
+**page = [page](access(self, "page"))**
+**fn = [fn](access(self, "fn"))**
1. `page`
- **path = [path](self)**
+ **path = [path](access(self, "path"))**
*> web_app_route app=`a` path=`path` page=`page`*
2. `fn`
- **path = [path](self)**
- **method = [method](self)**
- **request = [request](self)**
- **response = [response](self)**
+ **path = [path](access(self, "path"))**
+ **method = [method](access(self, "method"))**
+ **request = [request](access(self, "request"))**
+ **response = [response](access(self, "response"))**
*> web_app_invoke app=`a` path=`path` method=`method` fn=`fn` body=`request` return=`response`*
3. *
*> table.put in=None at="ok" value=False*
diff --git a/ext/web/web.mq.md b/ext/web/web.mq.md
index b3eef6d..2e5cfdd 100644
--- a/ext/web/web.mq.md
+++ b/ext/web/web.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/web
description: >-
Web Artifact facade (ADR 0007) — page · route · serve · render · inspect · use.
diff --git a/ext/web/网页.mq.md b/ext/web/网页.mq.md
index 624ff8d..4de037a 100644
--- a/ext/web/网页.mq.md
+++ b/ext/web/网页.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/web/网页
description: >-
Web Artifact 中文 facade(ADR 0007)— 页面 · 路由 · 服务 · 渲染 · 检视 · 使用。
diff --git a/lib/browser.mq.md b/lib/browser.mq.md
index 3512742..a8e9fb4 100644
--- a/lib/browser.mq.md
+++ b/lib/browser.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/browser
description: >-
Readable browser effect helpers for WASM clients. Prefer GFM tables + these
diff --git a/lib/cli.mq.md b/lib/cli.mq.md
index 9eadcbb..c6b673f 100644
--- a/lib/cli.mq.md
+++ b/lib/cli.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/cli
description: Parse argv flags (Mid M5). --key value / --key=value / --flag; positionals under _.
---
diff --git a/lib/csv.mq.md b/lib/csv.mq.md
index ee94ba9..a0793fd 100644
--- a/lib/csv.mq.md
+++ b/lib/csv.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/csv
description: RFC4180-ish CSV parse/stringify (Mid M4). First row = headers → list of maps.
---
diff --git a/lib/datetime.mq.md b/lib/datetime.mq.md
index 28edc5f..9c8a25c 100644
--- a/lib/datetime.mq.md
+++ b/lib/datetime.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/datetime
description: Calendar moments as maps {unix, zone, iso} (Mid2 M7). Fixed offsets + a few IANA aliases.
---
diff --git a/lib/encoding.mq.md b/lib/encoding.mq.md
index b723e20..f81bf4a 100644
--- a/lib/encoding.mq.md
+++ b/lib/encoding.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/encoding
description: Base64, hex, and base32 encode/decode (Mid M1 + Mid2 M8). UTF-8 text round-trip.
---
diff --git a/lib/foreign.mq.md b/lib/foreign.mq.md
index 09010a5..98f76c5 100644
--- a/lib/foreign.mq.md
+++ b/lib/foreign.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/foreign
description: Run bound code fences and inline sources via local interpreters
import:
diff --git a/lib/fs.mq.md b/lib/fs.mq.md
index 0056c27..cb771be 100644
--- a/lib/fs.mq.md
+++ b/lib/fs.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/fs
description: English filesystem wrappers
---
diff --git a/lib/hash.mq.md b/lib/hash.mq.md
index 67fc11c..aae98f7 100644
--- a/lib/hash.mq.md
+++ b/lib/hash.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/hash
description: Digests and HMAC (Mid M3). Integrity / cache keys — not password hashing.
---
diff --git a/lib/html.mq.md b/lib/html.mq.md
index 2835a74..5f85d45 100644
--- a/lib/html.mq.md
+++ b/lib/html.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/html
description: HTML escape / unescape (Mid2 M8). XSS floor for string assembly.
---
diff --git a/lib/json.mq.md b/lib/json.mq.md
index 380012c..49c6b88 100644
--- a/lib/json.mq.md
+++ b/lib/json.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/json
description: JSON parse/stringify (shared EN/ZH import). Not a dict builder — use lib/table.
---
diff --git a/lib/log.mq.md b/lib/log.mq.md
index 4592040..6251276 100644
--- a/lib/log.mq.md
+++ b/lib/log.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/log
description: Level-filtered one-line logs (Mid M6 + Mid2 M10 fields). Default level info.
---
diff --git a/lib/math.mq.md b/lib/math.mq.md
index 7f6a036..9896ba6 100644
--- a/lib/math.mq.md
+++ b/lib/math.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/math
description: High-school math — num, random, formula, plot
---
diff --git a/lib/net.mq.md b/lib/net.mq.md
index 212a410..88cc939 100644
--- a/lib/net.mq.md
+++ b/lib/net.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/net
description: English HTTP(S) wrappers. Optional headers / content_type via host aliases.
---
diff --git a/lib/path.mq.md b/lib/path.mq.md
index 0cf231d..b2f1a03 100644
--- a/lib/path.mq.md
+++ b/lib/path.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/path
description: Path algebra (Mid M2). No I/O; OS separators.
---
diff --git a/lib/plugin.mq.md b/lib/plugin.mq.md
index 38708c9..3bb13fb 100644
--- a/lib/plugin.mq.md
+++ b/lib/plugin.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/plugin
description: Load optional native ABI plugins (.dll / .so / .dylib)
---
diff --git a/lib/re.mq.md b/lib/re.mq.md
index 1897ba4..1282c4c 100644
--- a/lib/re.mq.md
+++ b/lib/re.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/re
description: Regular expressions (Mid M1). Unicode; no backreferences.
---
diff --git a/lib/secrets.mq.md b/lib/secrets.mq.md
index fb0ed3b..68c4aea 100644
--- a/lib/secrets.mq.md
+++ b/lib/secrets.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/secrets
description: Cryptographic tokens (Mid M3). Do not use math.random for secrets.
---
diff --git a/lib/stats.mq.md b/lib/stats.mq.md
index 205bc31..23e7c46 100644
--- a/lib/stats.mq.md
+++ b/lib/stats.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/stats
description: Thin mean / median / sample stdev (Mid2 M10). Not a dataframe library.
---
diff --git a/lib/subtask.mq.md b/lib/subtask.mq.md
index 271a176..069a7f7 100644
--- a/lib/subtask.mq.md
+++ b/lib/subtask.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/subtask
description: Concurrent subtasks — file, function, or foreign code
---
diff --git a/lib/sys.mq.md b/lib/sys.mq.md
index b3895b7..1d2c524 100644
--- a/lib/sys.mq.md
+++ b/lib/sys.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/sys
description: English system wrappers (load_dotenv accepts optional path via host alias)
---
diff --git a/lib/table.mq.md b/lib/table.mq.md
index 4538531..2a29afa 100644
--- a/lib/table.mq.md
+++ b/lib/table.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/table
description: >-
List and map helpers. Prefer put (1-based path, same nesting as link-index get);
diff --git a/lib/text.mq.md b/lib/text.mq.md
index 8bbbb5d..32c211e 100644
--- a/lib/text.mq.md
+++ b/lib/text.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/text
description: Text helpers (Mid M4). Literal replace — use lib/re for regex.
---
diff --git a/lib/time.mq.md b/lib/time.mq.md
index fab39f3..0fd6fe5 100644
--- a/lib/time.mq.md
+++ b/lib/time.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/time
description: English time wrappers
---
diff --git a/lib/toml.mq.md b/lib/toml.mq.md
index ed85028..b5ba000 100644
--- a/lib/toml.mq.md
+++ b/lib/toml.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/toml
description: Read-only TOML subset parse (Mid2 M8). Tables, scalars, arrays; no array-of-tables.
---
diff --git a/lib/url.mq.md b/lib/url.mq.md
index 087a7d3..79b4a05 100644
--- a/lib/url.mq.md
+++ b/lib/url.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/url
description: Parse URLs and query strings (Mid2 M7). Segment encoding stays in net.url_encode.
---
diff --git a/lib/uuid.mq.md b/lib/uuid.mq.md
index f8e8ade..58b0797 100644
--- a/lib/uuid.mq.md
+++ b/lib/uuid.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/uuid
description: UUID v4 (Mid M6). Cryptographic random via getrandom.
---
diff --git a/lib/writeback.mq.md b/lib/writeback.mq.md
index bccbd6e..118b4b6 100644
--- a/lib/writeback.mq.md
+++ b/lib/writeback.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/writeback
description: Persist run output in .mq.md (Jupyter-style writeback)
---
diff --git a/lib/命令行.mq.md b/lib/命令行.mq.md
index 4be7558..4dbd947 100644
--- a/lib/命令行.mq.md
+++ b/lib/命令行.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/命令行
description: 解析命令行参数(中层 M5)。--键 值 / --键=值 / --开关;位置参在 _。
---
diff --git a/lib/哈希.mq.md b/lib/哈希.mq.md
index 0414429..24b168e 100644
--- a/lib/哈希.mq.md
+++ b/lib/哈希.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/哈希
description: 摘要与 HMAC(中层 M3)。完整性 / 缓存键 — 非密码存储。
---
diff --git a/lib/地址.mq.md b/lib/地址.mq.md
index 3fec7cb..e839f39 100644
--- a/lib/地址.mq.md
+++ b/lib/地址.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/地址
description: 解析 URL 与查询串(中层 Mid2 M7)。单段编码仍用网络.网址编码。
---
diff --git a/lib/外联.mq.md b/lib/外联.mq.md
index 02777a2..c0787f5 100644
--- a/lib/外联.mq.md
+++ b/lib/外联.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/外联
description: 通过本机解释器运行绑定的代码围栏与内联源码
import:
diff --git a/lib/子任务.mq.md b/lib/子任务.mq.md
index 8b2b9f0..d794183 100644
--- a/lib/子任务.mq.md
+++ b/lib/子任务.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/子任务
description: 并发子任务 — 文件、函数或外联代码
---
diff --git a/lib/插件.mq.md b/lib/插件.mq.md
index fd26b8c..d68a9d8 100644
--- a/lib/插件.mq.md
+++ b/lib/插件.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/插件
description: 加载可选原生 ABI 插件(.dll / .so / .dylib)
---
diff --git a/lib/数学.mq.md b/lib/数学.mq.md
index 463d302..719caa9 100644
--- a/lib/数学.mq.md
+++ b/lib/数学.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/数学
description: 高中数学 — 数值、随机、公式、作图
---
diff --git a/lib/文件.mq.md b/lib/文件.mq.md
index 3b5f64f..d295653 100644
--- a/lib/文件.mq.md
+++ b/lib/文件.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/文件
description: 中文文件系统包装
---
diff --git a/lib/文本.mq.md b/lib/文本.mq.md
index 8d5b546..07ea9b3 100644
--- a/lib/文本.mq.md
+++ b/lib/文本.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/文本
description: 文本库加厚(中层 M4)。字面替换 — 正则请用 lib/正则。
---
diff --git a/lib/日志.mq.md b/lib/日志.mq.md
index 344d536..23168cf 100644
--- a/lib/日志.mq.md
+++ b/lib/日志.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/日志
description: 按级别过滤的一行日志(中层 M6 + Mid2 M10 字段)。默认级别 info。
---
diff --git a/lib/日期时间.mq.md b/lib/日期时间.mq.md
index 2891e31..7530c47 100644
--- a/lib/日期时间.mq.md
+++ b/lib/日期时间.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/日期时间
description: 日历时刻 map `{unix, zone, iso}`(中层 Mid2 M7)。固定偏移与少量 IANA 别名。
---
diff --git a/lib/时间.mq.md b/lib/时间.mq.md
index 52a6378..a570190 100644
--- a/lib/时间.mq.md
+++ b/lib/时间.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/时间
description: 中文时间包装
---
diff --git a/lib/机密.mq.md b/lib/机密.mq.md
index 9db874c..792790c 100644
--- a/lib/机密.mq.md
+++ b/lib/机密.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/机密
description: 安全随机令牌(中层 M3)。勿用 math.random 生成令牌。
---
diff --git a/lib/标识.mq.md b/lib/标识.mq.md
index 8c4a74a..344f766 100644
--- a/lib/标识.mq.md
+++ b/lib/标识.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/标识
description: UUID 版本 4(中层 M6)。经 getrandom 安全随机。
---
diff --git a/lib/正则.mq.md b/lib/正则.mq.md
index dd42a12..94ee4c4 100644
--- a/lib/正则.mq.md
+++ b/lib/正则.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/正则
description: 正则表达式(中层 M1)。Unicode;无回溯引用。
---
diff --git a/lib/浏览器.mq.md b/lib/浏览器.mq.md
index da1c378..9dabfc2 100644
--- a/lib/浏览器.mq.md
+++ b/lib/浏览器.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/浏览器
description: >-
浏览器效应助手(WASM 客户端)。优先 GFM 表格 + 本库;勿用 json.set 链拼效应。
diff --git a/lib/系统.mq.md b/lib/系统.mq.md
index 179e5d7..e2039cd 100644
--- a/lib/系统.mq.md
+++ b/lib/系统.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/系统
description: 中文系统包装(加载环境 可选 路径=)
---
diff --git a/lib/统计.mq.md b/lib/统计.mq.md
index 8fa5d79..82f19fa 100644
--- a/lib/统计.mq.md
+++ b/lib/统计.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/统计
description: 薄均值 / 中位数 / 样本标准差(中层 Mid2 M10)。非数据框库。
---
diff --git a/lib/编码.mq.md b/lib/编码.mq.md
index 9776631..2ac61dc 100644
--- a/lib/编码.mq.md
+++ b/lib/编码.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/编码
description: Base64、十六进制与基32编解码(中层 M1 + Mid2 M8)。UTF-8 文本往返。
---
diff --git a/lib/网络.mq.md b/lib/网络.mq.md
index 1c67c3e..8589255 100644
--- a/lib/网络.mq.md
+++ b/lib/网络.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/网络
description: 中文 HTTP(S) 包装。可选 headers / content_type 经宿主别名绑定。
---
diff --git a/lib/自写回.mq.md b/lib/自写回.mq.md
index a7748f0..4dc749c 100644
--- a/lib/自写回.mq.md
+++ b/lib/自写回.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/自写回
description: 将运行结果写回 .mq.md(Jupyter 式自写回)
---
diff --git a/lib/表.mq.md b/lib/表.mq.md
index dad0d1f..6ffd73c 100644
--- a/lib/表.mq.md
+++ b/lib/表.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/表
description: >-
列表与字典。优先用「改」(路径 1-based,与链接取元同构);取/改位/切片为 0-based。
diff --git a/lib/超文本.mq.md b/lib/超文本.mq.md
index 3e1ae16..3ca9078 100644
--- a/lib/超文本.mq.md
+++ b/lib/超文本.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/超文本
description: HTML 转义 / 还原(中层 Mid2 M8)。拼装字符串时的 XSS 底线。
---
diff --git a/lib/路径.mq.md b/lib/路径.mq.md
index 4c99aa6..b404c10 100644
--- a/lib/路径.mq.md
+++ b/lib/路径.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/路径
description: 路径代数(中层 M2)。无 I/O;分隔符随宿主 OS。
---
diff --git a/lib/逗号表.mq.md b/lib/逗号表.mq.md
index 01792e6..313b994 100644
--- a/lib/逗号表.mq.md
+++ b/lib/逗号表.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/逗号表
description: CSV 解析/序列化(中层 M4)。首行为表头 → 映射列表。
---
diff --git a/lib/配置表.mq.md b/lib/配置表.mq.md
index 32af58a..c84b8e4 100644
--- a/lib/配置表.mq.md
+++ b/lib/配置表.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/配置表
description: 只读 TOML 子集解析(中层 Mid2 M8)。表 / 标量 / 数组;无数组表。
---
diff --git a/man-test/ext/agent-plan.mq.md b/man-test/ext/agent-plan.mq.md
index 27d974c..dc4e2ae 100644
--- a/man-test/ext/agent-plan.mq.md
+++ b/man-test/ext/agent-plan.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: ext/agent plan live (DeepSeek)
description: Full plan loop — spawn workbook, inspect; simple pong goal.
import:
diff --git a/man-test/keyword/bool.mq.md b/man-test/keyword/bool.mq.md
index 89caf98..444a046 100644
--- a/man-test/keyword/bool.mq.md
+++ b/man-test/keyword/bool.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
---
diff --git a/man-test/keyword/input.mq.md b/man-test/keyword/input.mq.md
index e355a95..6093147 100644
--- a/man-test/keyword/input.mq.md
+++ b/man-test/keyword/input.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
---
diff --git a/man-test/keyword/print.mq.md b/man-test/keyword/print.mq.md
index ae899e8..3c480c5 100644
--- a/man-test/keyword/print.mq.md
+++ b/man-test/keyword/print.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
---
diff --git a/man-test/lib/math.mq.md b/man-test/lib/math.mq.md
index 3e47fdc..2f98dc9 100644
--- a/man-test/lib/math.mq.md
+++ b/man-test/lib/math.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
import:
diff --git a/man-test/lib/writeback.mq.md b/man-test/lib/writeback.mq.md
index 6e5da26..0e0f545 100644
--- a/man-test/lib/writeback.mq.md
+++ b/man-test/lib/writeback.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
import:
diff --git a/man-test/structure/loop.mq.md b/man-test/structure/loop.mq.md
index 56709bf..af3877f 100644
--- a/man-test/structure/loop.mq.md
+++ b/man-test/structure/loop.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 手工构造的测试样例
description: AI禁止更改
---
diff --git a/public/features/01-phase-i-treewalk.mq.md b/public/features/01-phase-i-treewalk.mq.md
index 50f4397..b5de2b9 100644
--- a/public/features/01-phase-i-treewalk.mq.md
+++ b/public/features/01-phase-i-treewalk.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Phase I — tree-walk interpreter
description: Lex · parse · check · tree-walk end to end
---
diff --git a/public/features/01-树遍历.mq.md b/public/features/01-树遍历.mq.md
index 2e69b6c..1282d6a 100644
--- a/public/features/01-树遍历.mq.md
+++ b/public/features/01-树遍历.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 第一阶段 — 树遍历解释器
description: 词法 · 语法 · 语义 · 树遍历已贯通
---
diff --git a/public/features/02-bytecode.mq.md b/public/features/02-bytecode.mq.md
index 79a404a..645fde4 100644
--- a/public/features/02-bytecode.mq.md
+++ b/public/features/02-bytecode.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Bytecode backend
description: `--backend bytecode` shares semantics with tree-walk
---
diff --git a/public/features/02-字节码.mq.md b/public/features/02-字节码.mq.md
index 50e3b33..77b0158 100644
--- a/public/features/02-字节码.mq.md
+++ b/public/features/02-字节码.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 字节码后端
description: `--backend bytecode` 与树遍历共用语义
---
diff --git a/public/features/03-view-and-docs.mq.md b/public/features/03-view-and-docs.mq.md
index 7bb374f..5ca771a 100644
--- a/public/features/03-view-and-docs.mq.md
+++ b/public/features/03-view-and-docs.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: view and the user docs site
description: Local browse and static export from the interpreter
---
diff --git a/public/features/03-view与文档.mq.md b/public/features/03-view与文档.mq.md
index 9bc3dcf..dd49f1b 100644
--- a/public/features/03-view与文档.mq.md
+++ b/public/features/03-view与文档.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: view 与用户文档站
description: 本地浏览与静态导出由解释器生成
---
diff --git a/public/features/04-objects.mq.md b/public/features/04-objects.mq.md
index c7ed088..fd59381 100644
--- a/public/features/04-objects.mq.md
+++ b/public/features/04-objects.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Objects and methods
description: Sharp heading is a type; deeper headings are functions or methods
---
diff --git a/public/features/04-对象.mq.md b/public/features/04-对象.mq.md
index deee1e0..bff0a48 100644
--- a/public/features/04-对象.mq.md
+++ b/public/features/04-对象.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 对象与方法
description: 一级标题是类型;更深标题是函数或方法
---
diff --git a/public/features/05-extensions.mq.md b/public/features/05-extensions.mq.md
index 4a4f7e0..49fff60 100644
--- a/public/features/05-extensions.mq.md
+++ b/public/features/05-extensions.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Official extensions (ext/)
description: Optional packages — not stdlib
---
diff --git a/public/features/05-扩展.mq.md b/public/features/05-扩展.mq.md
index cd20da6..8d8c5b5 100644
--- a/public/features/05-扩展.mq.md
+++ b/public/features/05-扩展.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 官方扩展(ext/)
description: 可选包 — 不是标准库
---
diff --git a/public/features/06-quantum.mq.md b/public/features/06-quantum.mq.md
index 1143a31..1d96764 100644
--- a/public/features/06-quantum.mq.md
+++ b/public/features/06-quantum.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Quantum circuits (ext/quantum)
description: Official quantum simulator — tables, gates, Q7 density, Q8 themed SVG
import:
diff --git a/public/features/06-量子.mq.md b/public/features/06-量子.mq.md
index 2e1215c..b9e7399 100644
--- a/public/features/06-量子.mq.md
+++ b/public/features/06-量子.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 量子电路(ext/quantum)
description: 官方量子模拟 — 表、门、Q7 密度与高级图、Q8 主题 SVG
导入:
diff --git a/public/features/07-linalg.mq.md b/public/features/07-linalg.mq.md
index 598376e..a3d499b 100644
--- a/public/features/07-linalg.mq.md
+++ b/public/features/07-linalg.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: How to write a linear-algebra formula document
description: ext/linalg formula-doc — declare, infix, run-implies-correct
import:
@@ -23,8 +24,8 @@ Declare symbols in a table, multiply, transpose — `T_ascii` is one-step displa
| 2 | B | 3 | 2 |
**`env` = > la.declare table=`shapes`**
-**`A` = [A](env)**
-**`B` = [B](env)**
+**`A` = [A](access(env, "A"))**
+**`B` = [B](access(env, "B"))**
**`P` = `A` * `B`**
**`t` = > `P`.T_ascii**
> print text=`t`
diff --git a/public/features/07-线性代数.mq.md b/public/features/07-线性代数.mq.md
index 9cbba72..5a2d966 100644
--- a/public/features/07-线性代数.mq.md
+++ b/public/features/07-线性代数.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 如何写线性代数公式文档
description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确
导入:
@@ -23,8 +24,8 @@ description: ext/linalg 公式文档面 — 声明、中缀、跑通即正确
| 2 | B | 3 | 2 |
**`环境` = > la.声明 表=`形状`**
-**`A` = [A](环境)**
-**`B` = [B](环境)**
+**`A` = [A](access(环境, "A"))**
+**`B` = [B](access(环境, "B"))**
**`P` = `A` * `B`**
**`t` = > `P`.转置文本**
> 打印 内容=`t`
diff --git a/public/features/08-re-encoding.mq.md b/public/features/08-re-encoding.mq.md
index 1ead15b..7a45139 100644
--- a/public/features/08-re-encoding.mq.md
+++ b/public/features/08-re-encoding.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Mid stdlib — regex and encoding
description: lib/re + lib/encoding without plugins (Mid M1)
import:
diff --git a/public/features/08-正则编解码.mq.md b/public/features/08-正则编解码.mq.md
index 304b415..068ccd0 100644
--- a/public/features/08-正则编解码.mq.md
+++ b/public/features/08-正则编解码.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中层标准库 — 正则与编解码
description: lib/正则 + lib/编码,无需插件(中层 M1)
导入:
diff --git a/public/features/09-path-fs.mq.md b/public/features/09-path-fs.mq.md
index 0fe6bf6..142a6e1 100644
--- a/public/features/09-path-fs.mq.md
+++ b/public/features/09-path-fs.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Mid stdlib — path and fs
description: lib/path + fs copy/move/temp (Mid M2)
import:
diff --git a/public/features/09-路径文件.mq.md b/public/features/09-路径文件.mq.md
index c9684ca..9c1d50e 100644
--- a/public/features/09-路径文件.mq.md
+++ b/public/features/09-路径文件.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中层标准库 — 路径与文件
description: lib/路径 + 文件复制/移动/临时(中层 M2)
导入:
diff --git a/public/features/10-hash-secrets.mq.md b/public/features/10-hash-secrets.mq.md
index 99c5b75..3548425 100644
--- a/public/features/10-hash-secrets.mq.md
+++ b/public/features/10-hash-secrets.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Mid stdlib — hash and secrets
description: lib/hash + lib/secrets without plugins (Mid M3)
import:
diff --git a/public/features/10-哈希机密.mq.md b/public/features/10-哈希机密.mq.md
index 8184e9e..4921ae4 100644
--- a/public/features/10-哈希机密.mq.md
+++ b/public/features/10-哈希机密.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中层标准库 — 哈希与机密
description: lib/哈希 + lib/机密,无需插件(中层 M3)
导入:
diff --git a/public/features/13-log-uuid.mq.md b/public/features/13-log-uuid.mq.md
index 8fadc88..317c8a4 100644
--- a/public/features/13-log-uuid.mq.md
+++ b/public/features/13-log-uuid.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Mid stdlib — log and uuid
description: Level-filtered logs + UUID v4 (Mid M6)
import:
diff --git a/public/features/13-日志标识.mq.md b/public/features/13-日志标识.mq.md
index b870379..3623694 100644
--- a/public/features/13-日志标识.mq.md
+++ b/public/features/13-日志标识.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中层标准库 — 日志与标识
description: 按级别过滤的日志 + UUID 版本4(中层 M6)
导入:
diff --git a/public/features/17-stats-log.mq.md b/public/features/17-stats-log.mq.md
index 21b7c4e..803d8aa 100644
--- a/public/features/17-stats-log.mq.md
+++ b/public/features/17-stats-log.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Mid stdlib — stats and log fields
description: Thin mean/median/stdev + structured log fields (Mid2 M10)
import:
diff --git a/public/features/17-统计日志.mq.md b/public/features/17-统计日志.mq.md
index 15824f6..167713b 100644
--- a/public/features/17-统计日志.mq.md
+++ b/public/features/17-统计日志.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中层标准库 — 统计与日志字段
description: 薄均值/中位数/标准差 + 日志 fields(Mid2 M10)
导入:
diff --git a/public/features/18-AI原生闭环.mq.md b/public/features/18-AI原生闭环.mq.md
index ec8e707..6ca5951 100644
--- a/public/features/18-AI原生闭环.mq.md
+++ b/public/features/18-AI原生闭环.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: AI 原生闭环(契约 + MLSP)
description: 渐进式契约、结构化诊断与面向 AI 的 Marqdo 语言服务
---
diff --git a/public/features/18-ai-native-loop.mq.md b/public/features/18-ai-native-loop.mq.md
index c44b80f..3c2116e 100644
--- a/public/features/18-ai-native-loop.mq.md
+++ b/public/features/18-ai-native-loop.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: AI-native loop (contracts + MLSP)
description: Progressive contracts, structured diagnostics, and the Marqdo Language Server for AI
---
diff --git a/public/features/20-OKF与EKC.mq.md b/public/features/20-OKF与EKC.mq.md
index 7f1acf1..40819a8 100644
--- a/public/features/20-OKF与EKC.mq.md
+++ b/public/features/20-OKF与EKC.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 代码即文档,文档即知识 — OKF 与 EKC
description: Marqdo 如何以一份可执行源为唯一权威,把它投影成 OKF 风格知识与 Engineering Knowledge Compiler 制品
---
diff --git a/public/features/20-okf-ekc.mq.md b/public/features/20-okf-ekc.mq.md
index 9766b34..813c11a 100644
--- a/public/features/20-okf-ekc.mq.md
+++ b/public/features/20-okf-ekc.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Code as documentation, documentation as knowledge — OKF and EKC
description: How Marqdo keeps one executable source of truth while projecting it into OKF-style knowledge and Engineering Knowledge Compiler artifacts
---
diff --git a/public/features/21-persistence.mq.md b/public/features/21-persistence.mq.md
index de61de1..5c95076 100644
--- a/public/features/21-persistence.mq.md
+++ b/public/features/21-persistence.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Persisting foreign execution results
description: Static snapshots and writeback — how foreign results survive after the process exits
import:
diff --git a/public/features/21-持久化.mq.md b/public/features/21-持久化.mq.md
index c58f0ad..c1dc650 100644
--- a/public/features/21-持久化.mq.md
+++ b/public/features/21-持久化.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 外联执行结果的持久化
description: 静态快照与自写回 —— 外联结果在进程退出后如何保留
导入:
diff --git a/public/keywords/bool-logic.mq.md b/public/keywords/bool-logic.mq.md
index a7ad675..9d02908 100644
--- a/public/keywords/bool-logic.mq.md
+++ b/public/keywords/bool-logic.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Booleans and logic
description: True / False / None and and / or / not
---
diff --git a/public/keywords/input.mq.md b/public/keywords/input.mq.md
index 35f7a5c..fb17a3f 100644
--- a/public/keywords/input.mq.md
+++ b/public/keywords/input.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Built-in input
description: Read one line from stdin; optional prompt. Demo via frontmatter stdin.
stdin: Ada
diff --git a/public/keywords/print.mq.md b/public/keywords/print.mq.md
index 8ce7708..0904f9c 100644
--- a/public/keywords/print.mq.md
+++ b/public/keywords/print.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Built-in print
description: Named and positional forms
---
diff --git a/public/keywords/stdlib.mq.md b/public/keywords/stdlib.mq.md
index c2b0a1c..9e573f7 100644
--- a/public/keywords/stdlib.mq.md
+++ b/public/keywords/stdlib.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Built-ins len / str / int / type / trim / split / join / at
description: Host builtins for strings and tables
---
diff --git a/public/keywords/内核双名.mq.md b/public/keywords/内核双名.mq.md
index b6684f0..1c29d62 100644
--- a/public/keywords/内核双名.mq.md
+++ b/public/keywords/内核双名.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 中英内核双名
description: 无需导入:打印、长度、文本、整数 与 print / len / …
---
diff --git a/public/keywords/布尔逻辑.mq.md b/public/keywords/布尔逻辑.mq.md
index 89d45ab..30c78de 100644
--- a/public/keywords/布尔逻辑.mq.md
+++ b/public/keywords/布尔逻辑.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 布尔与逻辑
description: 真 / 假 / 空 与 且 / 或 / 非
---
diff --git a/public/keywords/打印.mq.md b/public/keywords/打印.mq.md
index 07391e6..084bf3c 100644
--- a/public/keywords/打印.mq.md
+++ b/public/keywords/打印.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 内置 打印
description: 具名与位置两种写法
---
diff --git a/public/keywords/标准库.mq.md b/public/keywords/标准库.mq.md
index 7262bb3..7d729ed 100644
--- a/public/keywords/标准库.mq.md
+++ b/public/keywords/标准库.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 内置 长度 / 文本 / 整数 与 trim 等
description: 主机内置;中文别名覆盖常用几个
---
diff --git a/public/keywords/输入.mq.md b/public/keywords/输入.mq.md
index 58fd9ff..c37a995 100644
--- a/public/keywords/输入.mq.md
+++ b/public/keywords/输入.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 内置 输入
description: 从 stdin 读一行;可选提示。演示数据写在 frontmatter 输入。
输入: 小明
diff --git a/public/stdlib/00-overview.mq.md b/public/stdlib/00-overview.mq.md
index a68c418..07288f4 100644
--- a/public/stdlib/00-overview.mq.md
+++ b/public/stdlib/00-overview.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Standard library — overview
description: How to import official lib modules
---
diff --git a/public/stdlib/00-索引.mq.md b/public/stdlib/00-索引.mq.md
index 7f66cbd..40e9424 100644
--- a/public/stdlib/00-索引.mq.md
+++ b/public/stdlib/00-索引.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 标准库 — 总览
description: 如何导入官方 lib 模块
---
diff --git a/public/stdlib/fs.mq.md b/public/stdlib/fs.mq.md
index 65f8e51..c80dec1 100644
--- a/public/stdlib/fs.mq.md
+++ b/public/stdlib/fs.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/fs — files
description: Read and write text under the sandbox
import:
diff --git a/public/stdlib/json.mq.md b/public/stdlib/json.mq.md
index bc8f234..13e8fb5 100644
--- a/public/stdlib/json.mq.md
+++ b/public/stdlib/json.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/json — JSON
description: Shared EN/ZH path; parse and stringify (code-as-docs pilot)
import:
diff --git a/public/stdlib/math.mq.md b/public/stdlib/math.mq.md
index 41ee668..9dcc631 100644
--- a/public/stdlib/math.mq.md
+++ b/public/stdlib/math.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/math — numbers, formulas, plots
description: High-school math stdlib (English)
import:
diff --git a/public/stdlib/net.mq.md b/public/stdlib/net.mq.md
index ab03842..e6acbc8 100644
--- a/public/stdlib/net.mq.md
+++ b/public/stdlib/net.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/net — HTTP(S)
description: Minimal HTTP(S) client and URL encode
import:
diff --git a/public/stdlib/plugin.mq.md b/public/stdlib/plugin.mq.md
index 510d586..c3430d3 100644
--- a/public/stdlib/plugin.mq.md
+++ b/public/stdlib/plugin.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/plugin — native ABI
description: Load optional shared libraries (.dll / .so / .dylib)
import:
diff --git a/public/stdlib/subtask.mq.md b/public/stdlib/subtask.mq.md
index 0d64b8e..9d6ee36 100644
--- a/public/stdlib/subtask.mq.md
+++ b/public/stdlib/subtask.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/subtask — concurrent tasks
description: Spawn file, function, or foreign code in parallel
import:
diff --git a/public/stdlib/sys.mq.md b/public/stdlib/sys.mq.md
index 4e8ef79..d9b85bf 100644
--- a/public/stdlib/sys.mq.md
+++ b/public/stdlib/sys.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/sys — process
description: Env, dotenv, cwd, args, exit, exec
import:
diff --git a/public/stdlib/text.mq.md b/public/stdlib/text.mq.md
index f95680d..e604ed9 100644
--- a/public/stdlib/text.mq.md
+++ b/public/stdlib/text.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/text — strings
description: Trim, split, join (code-as-docs pilot)
import:
diff --git a/public/stdlib/time.mq.md b/public/stdlib/time.mq.md
index 8df2ba0..2cb06df 100644
--- a/public/stdlib/time.mq.md
+++ b/public/stdlib/time.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/time — clock
description: Unix time, format, parse, sleep
import:
diff --git a/public/stdlib/writeback.mq.md b/public/stdlib/writeback.mq.md
index 169d1e2..ac7e0a7 100644
--- a/public/stdlib/writeback.mq.md
+++ b/public/stdlib/writeback.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/writeback — Jupyter-style writeback
description: Persist run output in the entry .mq.md file
import:
diff --git a/public/stdlib/子任务.mq.md b/public/stdlib/子任务.mq.md
index c741c52..2b20472 100644
--- a/public/stdlib/子任务.mq.md
+++ b/public/stdlib/子任务.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/子任务 — 并发子任务
description: 文件、函数或外联代码并行执行
导入:
diff --git a/public/stdlib/插件.mq.md b/public/stdlib/插件.mq.md
index 395afcf..81d883c 100644
--- a/public/stdlib/插件.mq.md
+++ b/public/stdlib/插件.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/插件 — 原生 ABI
description: 加载可选共享库(.dll / .so / .dylib)
导入:
diff --git a/public/stdlib/数学.mq.md b/public/stdlib/数学.mq.md
index 22a03dc..9f4b1ec 100644
--- a/public/stdlib/数学.mq.md
+++ b/public/stdlib/数学.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/数学 — 数值、公式、作图
description: 高中数学标准库(中文)
导入:
diff --git a/public/stdlib/文件.mq.md b/public/stdlib/文件.mq.md
index 911cba4..dff678a 100644
--- a/public/stdlib/文件.mq.md
+++ b/public/stdlib/文件.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/文件 — 文件系统
description: 沙箱内读写文本
导入:
diff --git a/public/stdlib/文本.mq.md b/public/stdlib/文本.mq.md
index 916b830..ebf3597 100644
--- a/public/stdlib/文本.mq.md
+++ b/public/stdlib/文本.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/文本 — 字符串
description: 去空白、拆分、拼接(代码即文档试点)
导入:
diff --git a/public/stdlib/时间.mq.md b/public/stdlib/时间.mq.md
index ffb2ceb..f6a51c5 100644
--- a/public/stdlib/时间.mq.md
+++ b/public/stdlib/时间.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/时间 — 时钟
description: Unix 时间、格式化、解析、睡眠
导入:
diff --git a/public/stdlib/系统.mq.md b/public/stdlib/系统.mq.md
index 7cd994a..32fa3b4 100644
--- a/public/stdlib/系统.mq.md
+++ b/public/stdlib/系统.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/系统 — 进程
description: 环境变量、dotenv、工作目录、参数、退出、执行
导入:
diff --git a/public/stdlib/网络.mq.md b/public/stdlib/网络.mq.md
index daad6a1..2f69aab 100644
--- a/public/stdlib/网络.mq.md
+++ b/public/stdlib/网络.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/网络 — HTTP
description: HTTP(S) 与地址编码
导入:
diff --git a/public/stdlib/自写回.mq.md b/public/stdlib/自写回.mq.md
index 1371327..32b9e7c 100644
--- a/public/stdlib/自写回.mq.md
+++ b/public/stdlib/自写回.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: lib/自写回 — Jupyter 式写回
description: 把运行结果写回入口 .mq.md
导入:
diff --git a/public/structure/01-hello.mq.md b/public/structure/01-hello.mq.md
index 701da23..dc3313b 100644
--- a/public/structure/01-hello.mq.md
+++ b/public/structure/01-hello.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Hello World
description: Smallest runnable doc
---
diff --git a/public/structure/01-你好.mq.md b/public/structure/01-你好.mq.md
index 260e089..877d751 100644
--- a/public/structure/01-你好.mq.md
+++ b/public/structure/01-你好.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 你好世界
description: 最小可运行文档
---
diff --git a/public/structure/02-function.mq.md b/public/structure/02-function.mq.md
index 07b933a..630d10f 100644
--- a/public/structure/02-function.mq.md
+++ b/public/structure/02-function.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Functions and named calls
description: `#` defines functions; `>` calls; `-` lists parameter names
---
diff --git a/public/structure/02-函数.mq.md b/public/structure/02-函数.mq.md
index 6020840..005631e 100644
--- a/public/structure/02-函数.mq.md
+++ b/public/structure/02-函数.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 函数与具名调用
description: `#` 定义函数;`>` 调用;`-` 列出参数名
---
diff --git a/public/structure/03-positional-call.mq.md b/public/structure/03-positional-call.mq.md
index 84493c3..8b69aac 100644
--- a/public/structure/03-positional-call.mq.md
+++ b/public/structure/03-positional-call.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Positional arguments
description: Bind by parameter order; named form still works
---
diff --git a/public/structure/03-位置调用.mq.md b/public/structure/03-位置调用.mq.md
index cf41d96..321a7f8 100644
--- a/public/structure/03-位置调用.mq.md
+++ b/public/structure/03-位置调用.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 位置实参
description: 按参数声明顺序绑定;具名写法仍然可用
---
diff --git a/public/structure/04-branch.mq.md b/public/structure/04-branch.mq.md
index 106cb26..fb7245e 100644
--- a/public/structure/04-branch.mq.md
+++ b/public/structure/04-branch.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Branch
description: `+` arms; a lone `*` arm is else
---
diff --git a/public/structure/04-分支.mq.md b/public/structure/04-分支.mq.md
index b7c9f25..56f57c2 100644
--- a/public/structure/04-分支.mq.md
+++ b/public/structure/04-分支.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 分支
description: `+` 各臂;单独的 `*` 臂为否则
---
diff --git a/public/structure/09-inherit.mq.md b/public/structure/09-inherit.mq.md
index add8df2..430703b 100644
--- a/public/structure/09-inherit.mq.md
+++ b/public/structure/09-inherit.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Object inheritance
description: "# Child = > Parent; methods walk the base chain"
---
diff --git a/public/structure/09-继承.mq.md b/public/structure/09-继承.mq.md
index e54dea1..b95ed84 100644
--- a/public/structure/09-继承.mq.md
+++ b/public/structure/09-继承.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 对象继承
description: "# 子类 = > 父类;方法沿基类链查找"
---
diff --git a/public/structure/import/main.mq.md b/public/structure/import/main.mq.md
index e498804..dcdc4ed 100644
--- a/public/structure/import/main.mq.md
+++ b/public/structure/import/main.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Cross-file import
description: Frontmatter nested import: map
import:
diff --git a/public/structure/import/utils.mq.md b/public/structure/import/utils.mq.md
index 5c76ec1..7323745 100644
--- a/public/structure/import/utils.mq.md
+++ b/public/structure/import/utils.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: Utility module
description: Imported by main; italic is return; print for side effects
---
diff --git a/public/structure/import/主.mq.md b/public/structure/import/主.mq.md
index 6ae18e2..2328521 100644
--- a/public/structure/import/主.mq.md
+++ b/public/structure/import/主.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 跨文件导入
description: frontmatter 导入 bind:路径.mq.md
导入:
diff --git a/public/structure/import/工具.mq.md b/public/structure/import/工具.mq.md
index ae24097..4dd9436 100644
--- a/public/structure/import/工具.mq.md
+++ b/public/structure/import/工具.mq.md
@@ -1,4 +1,5 @@
---
+markup: occlusion
title: 工具模块
description: 被 main 导入;斜体为返回;副作用用打印
---
diff --git a/src/load.rs b/src/load.rs
index e6416d5..1ca4bb7 100644
--- a/src/load.rs
+++ b/src/load.rs
@@ -14,7 +14,10 @@ use crate::parse::parse_source;
/// Load `path` and recursively bind imported modules (no flat merge).
pub fn load_module(path: &Path) -> Result {
- load_module_with_ctx(path, &BindingContext::from_binds(&[], cwd_for_path(Some(path))))
+ load_module_with_ctx(
+ path,
+ &BindingContext::from_binds(&[], cwd_for_path(Some(path))),
+ )
}
/// Load with BindingContext (CLI `--bind`, cwd for `sys.cwd`).
@@ -28,9 +31,7 @@ fn load_module_inner(
visited: &mut HashSet,
ctx: &BindingContext,
) -> Result {
- let canon = path
- .canonicalize()
- .unwrap_or_else(|_| path.to_path_buf());
+ let canon = path.canonicalize().unwrap_or_else(|_| path.to_path_buf());
if !visited.insert(canon.clone()) {
bail!("circular import involving {}", path.display());
}
@@ -86,7 +87,9 @@ fn read_module_source(path: &Path) -> Result {
}
fn read_embedded_for_path(path: &Path) -> Option {
- lib_remainder(path).as_deref().and_then(embedded_lib::read_file)
+ lib_remainder(path)
+ .as_deref()
+ .and_then(embedded_lib::read_file)
}
fn lib_remainder(path: &Path) -> Option {
@@ -156,10 +159,7 @@ pub fn resolve_import(from_dir: &Path, rel: &str) -> Result {
if let Some(p) = find_in_ancestor_dir(from_dir, "ext", rest) {
return Ok(p);
}
- let mut msg = format!(
- "cannot resolve import `{rel}` from {}",
- from_dir.display()
- );
+ let mut msg = format!("cannot resolve import `{rel}` from {}", from_dir.display());
#[cfg(feature = "cli")]
{
let user_ext = crate::ext_cli::default_user_ext_dir();
@@ -290,9 +290,10 @@ fn label_error(label: &str, e: anyhow::Error) -> anyhow::Error {
/// Effective markup mode declared by the file itself. `` M7
///
/// Looks for `markup: occlusion` (or `标记: 遮蔽`) inside the leading frontmatter
-/// block. Files that say nothing retain the compatibility default (`classic`)
-/// until the full library migration lands. There is no environment/process
-/// default: an explicit file declaration always decides its own grammar.
+/// block. Unmarked sources use the new `occlusion` default; a legacy source
+/// must opt in with `markup: classic` or be run through `--legacy-markup` for
+/// the transition cycle. There is no environment/process default: an explicit
+/// file declaration always decides its own grammar.
/// Parse a standalone source the way the file itself declares (`markup:` in
/// frontmatter). The viewer must use this — otherwise an occluded document is
/// re-parsed in classic mode and fails. `` M7/M8
@@ -409,11 +410,8 @@ mod tests {
let prev = env::var_os("MARQDO_EXT");
env::remove_var("MARQDO_EXT");
// Unique path so cwd/ext cannot satisfy the import.
- let err = resolve_import(
- Path::new("/tmp"),
- "ext/__gap12_missing__/nope.mq.md",
- )
- .unwrap_err();
+ let err =
+ resolve_import(Path::new("/tmp"), "ext/__gap12_missing__/nope.mq.md").unwrap_err();
let msg = format!("{err:#}");
match prev {
Some(v) => env::set_var("MARQDO_EXT", v),
diff --git a/src/main.rs b/src/main.rs
index 5be181b..2ffb69c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -57,6 +57,10 @@ enum MigrateAction {
/// Actually rewrite files (default: dry run)
#[arg(long)]
write: bool,
+ /// Add `markup: occlusion` to every unmarked file, including files
+ /// with no legacy index. Use this when migrating a shipped library.
+ #[arg(long)]
+ mark: bool,
/// One JSON object on stdout
#[arg(long)]
json: bool,
@@ -550,7 +554,9 @@ fn resolve_knowledge_reference<'a>(
anyhow::bail!("knowledge reference `{reference}` must be a dotted value path or mq:// URI");
};
if !call.args.is_empty() {
- anyhow::bail!("knowledge resolve only binds a zero-argument path; `{reference}` has arguments");
+ anyhow::bail!(
+ "knowledge resolve only binds a zero-argument path; `{reference}` has arguments"
+ );
}
let path = call.path.ok_or_else(|| {
anyhow::anyhow!("knowledge reference `{reference}` must start with an imported module bind")
@@ -566,7 +572,9 @@ fn resolve_knowledge_reference<'a>(
.imports
.iter()
.find(|item| item.bind == path[0])
- .ok_or_else(|| anyhow::anyhow!("unknown import bind `{}` in {}", path[0], from.display()))?;
+ .ok_or_else(|| {
+ anyhow::anyhow!("unknown import bind `{}` in {}", path[0], from.display())
+ })?;
let base = from.parent().unwrap_or_else(|| std::path::Path::new("."));
let imported_path = marqdo::load::resolve_import(base, &imported.path)?;
let imported_path = imported_path.canonicalize().unwrap_or(imported_path);
@@ -872,26 +880,36 @@ fn try_main(cli: Cli) -> Result {
Ok(0)
}
Commands::Migrate { action } => match action {
- MigrateAction::Labels { paths, write, json } => {
+ MigrateAction::Labels {
+ paths,
+ write,
+ mark,
+ json,
+ } => {
let mut reports = Vec::new();
for p in &paths {
- reports.extend(marqdo::migrate::migrate_path(p, write)?);
+ reports.extend(marqdo::migrate::migrate_path_with_options(p, write, mark)?);
}
- let (mut idx, mut loops, mut applied) = (0usize, 0usize, 0usize);
+ let (mut idx, mut loops, mut marked, mut applied) =
+ (0usize, 0usize, 0usize, 0usize);
for r in &reports {
idx += r.indexes;
loops += r.loops;
+ marked += usize::from(r.mode_marked);
applied += usize::from(r.applied);
}
if json {
let arr: Vec = reports
.iter()
- .filter(|r| r.indexes > 0 || r.loops > 0 || r.note.is_some())
+ .filter(|r| {
+ r.indexes > 0 || r.loops > 0 || r.mode_marked || r.note.is_some()
+ })
.map(|r| {
serde_json::json!({
"file": r.file.display().to_string(),
"indexes": r.indexes,
"loops": r.loops,
+ "mode_marked": r.mode_marked,
"applied": r.applied,
"note": r.note,
})
@@ -900,7 +918,7 @@ fn try_main(cli: Cli) -> Result {
println!("{}", serde_json::Value::Array(arr));
} else {
for r in &reports {
- if r.indexes == 0 && r.loops == 0 {
+ if r.indexes == 0 && r.loops == 0 && !r.mode_marked {
continue;
}
let state = if r.applied {
@@ -911,10 +929,15 @@ fn try_main(cli: Cli) -> Result {
"would change"
};
println!(
- "{} indexes={} loops={} {}{}",
+ "{} indexes={} loops={} mode={} {}{}",
r.file.display(),
r.indexes,
r.loops,
+ if r.mode_marked {
+ "occlusion"
+ } else {
+ "unchanged"
+ },
state,
r.note
.as_ref()
@@ -923,7 +946,7 @@ fn try_main(cli: Cli) -> Result {
);
}
println!(
- "migrate labels: {idx} index, {loops} loop, {applied} file written{}",
+ "migrate labels: {idx} index, {loops} loop, {marked} explicit mode, {applied} file written{}",
if write {
""
} else {
@@ -942,9 +965,10 @@ fn try_main(cli: Cli) -> Result {
for r in &reports {
bindings += r.bindings;
applied += usize::from(r.applied);
- if r.note.as_ref().is_some_and(|n| {
- n != "no legacy import one-liners"
- }) && r.bindings == 0
+ if r.note
+ .as_ref()
+ .is_some_and(|n| n != "no legacy import one-liners")
+ && r.bindings == 0
{
problems += 1;
}
@@ -952,7 +976,12 @@ fn try_main(cli: Cli) -> Result {
if json {
let arr: Vec = reports
.iter()
- .filter(|r| r.bindings > 0 || r.note.as_ref().is_some_and(|n| n != "no legacy import one-liners"))
+ .filter(|r| {
+ r.bindings > 0
+ || r.note
+ .as_ref()
+ .is_some_and(|n| n != "no legacy import one-liners")
+ })
.map(|r| {
serde_json::json!({
"file": r.file.display().to_string(),
@@ -965,7 +994,11 @@ fn try_main(cli: Cli) -> Result {
println!("{}", serde_json::Value::Array(arr));
} else {
for r in &reports {
- if r.bindings == 0 && r.note.as_ref().is_some_and(|n| n == "no legacy import one-liners") {
+ if r.bindings == 0
+ && r.note
+ .as_ref()
+ .is_some_and(|n| n == "no legacy import one-liners")
+ {
continue;
}
if r.bindings == 0 {
@@ -1155,7 +1188,9 @@ fn try_main(cli: Cli) -> Result {
"{}\n {}{} {} · module {}\n {}:{}",
item.id,
item.kind.as_str(),
- item.callable.map(|kind| format!(" ({})", kind.as_str())).unwrap_or_default(),
+ item.callable
+ .map(|kind| format!(" ({})", kind.as_str()))
+ .unwrap_or_default(),
item.declaration_path.join("."),
item.module,
item.source.display(),
@@ -1172,15 +1207,17 @@ fn try_main(cli: Cli) -> Result {
Ok(0)
}
KnowledgeAction::Resolve { reference, from } => {
- let from = from.as_deref().or_else(|| path.is_file().then_some(path.as_path()));
+ let from = from
+ .as_deref()
+ .or_else(|| path.is_file().then_some(path.as_path()));
let index = marqdo::sema::ProjectIndex::build(if path.is_dir() {
marqdo::project::ProjectRoot::new(&path)?
} else {
marqdo::project::ProjectRoot::discover(&path)?
})?;
let symbol = resolve_knowledge_reference(&index, &reference, from)?;
- let instance_only = symbol.callable
- == Some(marqdo::sema::CallableKind::InstanceMethod);
+ let instance_only =
+ symbol.callable == Some(marqdo::sema::CallableKind::InstanceMethod);
if json {
println!(
"{}",
@@ -1209,32 +1246,83 @@ fn try_main(cli: Cli) -> Result {
}
KnowledgeAction::Lock { update, strict } => {
let semantic_root = if path.is_file() {
- path.parent().unwrap_or_else(|| std::path::Path::new(".")).to_path_buf()
+ path.parent()
+ .unwrap_or_else(|| std::path::Path::new("."))
+ .to_path_buf()
} else {
path.clone()
};
- let compilation = marqdo::sema::compile_project(&marqdo::sema::CompileOptions {
- project_root: semantic_root,
- entry: path.is_file().then(|| path.clone()),
- lock_mode: if strict { marqdo::sema::LockMode::Strict } else { marqdo::sema::LockMode::Check },
- })?;
+ let compilation =
+ marqdo::sema::compile_project(&marqdo::sema::CompileOptions {
+ project_root: semantic_root,
+ entry: path.is_file().then(|| path.clone()),
+ lock_mode: if strict {
+ marqdo::sema::LockMode::Strict
+ } else {
+ marqdo::sema::LockMode::Check
+ },
+ })?;
if update {
marqdo::sema::update_links_lock(&out, &compilation.semantics)?;
let body = serde_json::json!({"schema_version": 1, "status": "updated", "path": out.join("links.lock.json")});
- if json { println!("{body}"); } else { println!("knowledge lock updated: {}", out.join("links.lock.json").display()); }
+ if json {
+ println!("{body}");
+ } else {
+ println!(
+ "knowledge lock updated: {}",
+ out.join("links.lock.json").display()
+ );
+ }
Ok(0)
} else {
let report = marqdo::sema::check_links_lock(&out, &compilation.semantics)?;
- if json { println!("{}", report.to_json()); } else { println!("knowledge lock: {}", report.status); for id in report.missing.iter().chain(report.changed.iter()).chain(report.removed.iter()) { println!(" {id}"); } }
+ if json {
+ println!("{}", report.to_json());
+ } else {
+ println!("knowledge lock: {}", report.status);
+ for id in report
+ .missing
+ .iter()
+ .chain(report.changed.iter())
+ .chain(report.removed.iter())
+ {
+ println!(" {id}");
+ }
+ }
Ok(if strict && !report.is_clean() { 3 } else { 0 })
}
}
KnowledgeAction::Impact { query } => {
- let semantic_root = if path.is_file() { path.parent().unwrap_or_else(|| std::path::Path::new(".")).to_path_buf() } else { path.clone() };
- let compilation = marqdo::sema::compile_project(&marqdo::sema::CompileOptions { project_root: semantic_root, entry: path.is_file().then(|| path.clone()), lock_mode: marqdo::sema::LockMode::Off })?;
+ let semantic_root = if path.is_file() {
+ path.parent()
+ .unwrap_or_else(|| std::path::Path::new("."))
+ .to_path_buf()
+ } else {
+ path.clone()
+ };
+ let compilation =
+ marqdo::sema::compile_project(&marqdo::sema::CompileOptions {
+ project_root: semantic_root,
+ entry: path.is_file().then(|| path.clone()),
+ lock_mode: marqdo::sema::LockMode::Off,
+ })?;
let report = marqdo::sema::semantic_impact(&compilation.semantics, &query);
- if json { println!("{report}"); } else { for item in report["affected"].as_array().into_iter().flatten() { println!("{} {}", item["artifact_id"].as_str().unwrap_or(""), item["display_name"].as_str().unwrap_or("")); } }
- Ok(if report["resolved"].as_bool() == Some(true) { 0 } else { 1 })
+ if json {
+ println!("{report}");
+ } else {
+ for item in report["affected"].as_array().into_iter().flatten() {
+ println!(
+ "{} {}",
+ item["artifact_id"].as_str().unwrap_or(""),
+ item["display_name"].as_str().unwrap_or("")
+ );
+ }
+ }
+ Ok(if report["resolved"].as_bool() == Some(true) {
+ 0
+ } else {
+ 1
+ })
}
KnowledgeAction::Preflight {
task,
diff --git a/src/migrate.rs b/src/migrate.rs
index 39c7964..c72ab49 100644
--- a/src/migrate.rs
+++ b/src/migrate.rs
@@ -20,6 +20,9 @@ pub struct FileReport {
pub file: PathBuf,
pub indexes: usize,
pub loops: usize,
+ /// Whether this file will receive (or already has) an explicit
+ /// `markup: occlusion` declaration.
+ pub mode_marked: bool,
pub applied: bool,
pub note: Option,
}
@@ -45,7 +48,10 @@ fn has_marker(source: &str) -> bool {
}
let lower = t.to_ascii_lowercase();
if lower.starts_with("markup:") || t.starts_with("标记:") {
- return lower.contains("occlusion") || lower.contains("purity") || t.contains("遮蔽") || t.contains("纯度");
+ return lower.contains("occlusion")
+ || lower.contains("purity")
+ || t.contains("遮蔽")
+ || t.contains("纯度");
}
}
false
@@ -64,10 +70,14 @@ fn add_marker(source: &str) -> String {
if lower.starts_with("markup:") || line.trim().starts_with("标记:") {
*line = "markup: occlusion".to_string();
let mut out = lines.join("\n");
- if source.ends_with('\n') { out.push('\n'); }
+ if source.ends_with('\n') {
+ out.push('\n');
+ }
return out;
}
- if line.trim() == "---" && index != 0 { break; }
+ if line.trim() == "---" && index != 0 {
+ break;
+ }
}
}
if let Some(rest) = source.strip_prefix("---\n") {
@@ -162,10 +172,7 @@ fn rewrite_one_innermost(line: &str) -> Option {
} else {
quote_key(k)
};
- let replaced = format!(
- "[{label}](access({}, {key_arg}))",
- coll.trim()
- );
+ let replaced = format!("[{label}](access({}, {key_arg}))", coll.trim());
let mut out = String::new();
out.extend(chars[..i].iter());
out.push_str(&replaced);
@@ -284,9 +291,7 @@ fn rewrite_loop(line: &str) -> Option {
}
let indent = &line[..line.len() - trimmed.len()];
let shown = item.trim_matches('`').to_string();
- Some(format!(
- "{indent}- [{shown}](遍历 {coll} 为 {item})"
- ))
+ Some(format!("{indent}- [{shown}](遍历 {coll} 为 {item})"))
}
fn says_foreach(s: &str) -> bool {
@@ -310,7 +315,9 @@ fn denorm_expr(expr: &Expr) -> Expr {
_ => return expr.clone(),
};
let key_label = match key {
- Expr::Literal(crate::ast::Literal::Text(t)) if t == label => Some(IndexKey::Lit(t.clone())),
+ Expr::Literal(crate::ast::Literal::Text(t)) if t == label => {
+ Some(IndexKey::Lit(t.clone()))
+ }
Expr::Var(v) if v == label => Some(IndexKey::Var(v.clone())),
_ => None,
};
@@ -401,7 +408,10 @@ fn denorm_stmt(stmt: &Stmt) -> Stmt {
},
})
.collect();
- Stmt::Call { call: c, span: *span }
+ Stmt::Call {
+ call: c,
+ span: *span,
+ }
}
Stmt::Branch { arms, span } => Stmt::Branch {
arms: arms
@@ -477,22 +487,40 @@ fn shape(module: &Module) -> String {
/// Migrate one file. `write=false` performs a dry run (still fully verified).
pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result {
+ migrate_file_with_options(path, write, false)
+}
+
+/// Migrate one file and, when `mark_all` is set, give a file that has no
+/// legacy index an explicit new-syntax declaration too. This is the mode used
+/// for shipped libraries: their behavior must not depend on the process
+/// default even if they happen not to contain a link-shaped index today.
+pub fn migrate_file_with_options(
+ path: &Path,
+ write: bool,
+ mark_all: bool,
+) -> anyhow::Result {
let source = std::fs::read_to_string(path)?;
let mut report = FileReport {
file: path.to_path_buf(),
indexes: 0,
loops: 0,
+ mode_marked: false,
applied: false,
note: None,
};
if has_marker(&source) {
+ report.mode_marked = true;
report.note = Some("already marked `markup: occlusion`".into());
return Ok(report);
}
- // The original must be readable in classic mode (that is what it means today).
+ // Migration is deliberately syntax-only. Resolving imports here makes a
+ // library's safe local rewrite depend on the host checkout, unavailable
+ // plugins, or a transitive dependency that is itself being migrated.
+ // Import resolution and both execution backends are verified afterwards by
+ // the repository migration suite.
let original = crate::parse::expr::with_markup(crate::parse::expr::Markup::Classic, || {
- crate::load::load_module(path)
+ crate::parse::parse_source(&source)
})?;
let classified = crate::lex::classify_source(&source);
@@ -516,7 +544,7 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result {
lines[idx] = new_line;
}
}
- if report.indexes == 0 && report.loops == 0 {
+ if report.indexes == 0 && report.loops == 0 && !mark_all {
report.note = Some("no legacy index or loop".into());
return Ok(report);
}
@@ -526,11 +554,12 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result {
body.push('\n');
}
let migrated = add_marker(&body);
+ report.mode_marked = true;
// Prove equivalence: the migrated file, parsed in occlusion mode and
// denormalized, must be structurally identical to the original.
let reparsed = crate::parse::expr::with_markup(crate::parse::expr::Markup::Occlusion, || {
- crate::load::load_module_from_source(&migrated)
+ crate::parse::parse_source(&migrated)
})?;
if std::env::var("MARQDO_MIGRATE_DEBUG").is_ok() {
eprintln!("ORIG: {}", shape(&original));
@@ -550,15 +579,25 @@ pub fn migrate_file(path: &Path, write: bool) -> anyhow::Result {
/// Recursively migrate every `*.mq.md` under `path`.
pub fn migrate_path(path: &Path, write: bool) -> anyhow::Result> {
+ migrate_path_with_options(path, write, false)
+}
+
+/// Recursive counterpart of [`migrate_file_with_options`].
+pub fn migrate_path_with_options(
+ path: &Path,
+ write: bool,
+ mark_all: bool,
+) -> anyhow::Result> {
let files = crate::migrate::collect_files(path);
let mut out = Vec::new();
for f in files {
- match migrate_file(&f, write) {
+ match migrate_file_with_options(&f, write, mark_all) {
Ok(r) => out.push(r),
Err(e) => out.push(FileReport {
file: f,
indexes: 0,
loops: 0,
+ mode_marked: false,
applied: false,
note: Some(format!("load failed: {e:#}")),
}),
@@ -731,12 +770,17 @@ pub fn migrate_imports_path(path: &Path, write: bool) -> anyhow::Result Vec {
fn walk(dir: &Path, out: &mut Vec) {
- let Ok(rd) = std::fs::read_dir(dir) else { return };
+ let Ok(rd) = std::fs::read_dir(dir) else {
+ return;
+ };
for e in rd.flatten() {
let p = e.path();
let name = p.file_name().and_then(|n| n.to_str()).unwrap_or("");
if p.is_dir() {
- if matches!(name, "target" | "dist" | "node_modules" | ".git" | ".marqdo") {
+ if matches!(
+ name,
+ "target" | "dist" | "node_modules" | ".git" | ".marqdo"
+ ) {
continue;
}
walk(&p, out);
@@ -760,7 +804,8 @@ mod tests {
#[test]
fn rewrites_import_oneliners_to_nested() {
- let src = "---\ntitle: t\nimport json:lib/json.mq.md\nimport fmt:time.format\n---\n\n# main\n";
+ let src =
+ "---\ntitle: t\nimport json:lib/json.mq.md\nimport fmt:time.format\n---\n\n# main\n";
let (out, n) = rewrite_import_frontmatter(src).unwrap().unwrap();
assert_eq!(n, 2);
assert!(out.contains("import:\n json: lib/json.mq.md\n fmt: time.format\n"));
diff --git a/src/parse/expr.rs b/src/parse/expr.rs
index 48ace79..15c3791 100644
--- a/src/parse/expr.rs
+++ b/src/parse/expr.rs
@@ -11,13 +11,14 @@ pub fn parse_expr(input: &str) -> Result {
/// Markup mode for `[描述](实现)` vs the legacy `[键](集合)` index. `` M2
///
/// `Classic` keeps the legacy index semantics; `Occlusion` reads the same shape
-/// as an occlusion. The compatibility default remains `Classic` until every
-/// shipped library has an explicit per-file declaration; new syntax opts in
-/// with `markup: occlusion`. No environment/process switch exists.
+/// as an occlusion. Every shipped module declares its mode and new/unmarked
+/// sources use `Occlusion`. The legacy grammar is available only through an
+/// explicit `markup: classic` declaration or the one-cycle CLI compatibility
+/// flag. No environment/process switch exists.
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub enum Markup {
- #[default]
Classic,
+ #[default]
Occlusion,
}
@@ -43,7 +44,7 @@ pub fn markup_default() -> Markup {
if let Some(m) = MARKUP_OVERRIDE.with(|c| c.get()) {
return m;
}
- Markup::Classic
+ Markup::Occlusion
}
/// Italic / bold value syntax: bare words are variables; text needs `"…"` / `'…'`.
@@ -160,7 +161,10 @@ fn is_text_only_div_chain(e: &Expr) -> bool {
op: BinaryOp::Div,
left,
right,
- } => is_text_only_div_chain(left) && matches!(right.as_ref(), Expr::Literal(Literal::Text(_))),
+ } => {
+ is_text_only_div_chain(left)
+ && matches!(right.as_ref(), Expr::Literal(Literal::Text(_)))
+ }
_ => false,
}
}
@@ -196,7 +200,10 @@ fn has_hyphenated_prose(s: &str) -> bool {
continue;
}
// `none-falsy` / `Hello-World` — not `` `n` - 1 ``
- if left.is_alphanumeric() || right.is_alphanumeric() || !left.is_ascii() || !right.is_ascii()
+ if left.is_alphanumeric()
+ || right.is_alphanumeric()
+ || !left.is_ascii()
+ || !right.is_ascii()
{
return true;
}
@@ -598,7 +605,10 @@ impl<'a> Parser<'a> {
self.i += '空'.len_utf8();
return Ok(Expr::Literal(Literal::None));
}
- if self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false)
+ if self
+ .peek_char()
+ .map(|c| c.is_ascii_digit())
+ .unwrap_or(false)
|| (self.peek_char() == Some('.')
&& self
.rest()
@@ -608,13 +618,21 @@ impl<'a> Parser<'a> {
.unwrap_or(false))
{
let start = self.i;
- while self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false) {
+ while self
+ .peek_char()
+ .map(|c| c.is_ascii_digit())
+ .unwrap_or(false)
+ {
self.bump_char();
}
if self.peek_char() == Some('.') {
self.bump_char();
let frac_start = self.i;
- while self.peek_char().map(|c| c.is_ascii_digit()).unwrap_or(false) {
+ while self
+ .peek_char()
+ .map(|c| c.is_ascii_digit())
+ .unwrap_or(false)
+ {
self.bump_char();
}
// Require at least one digit on one side of the dot.
@@ -633,7 +651,10 @@ impl<'a> Parser<'a> {
}
// Bare identifier / text word. If immediately followed by `[^…]`, treat as
// variable + footnote index (exemption: ticks optional when `[^` marks the slot).
- if self.peek_char().map(|c| c.is_alphanumeric() || c == '_' || !c.is_ascii()).unwrap_or(false)
+ if self
+ .peek_char()
+ .map(|c| c.is_alphanumeric() || c == '_' || !c.is_ascii())
+ .unwrap_or(false)
{
let start = self.i;
while let Some(c) = self.peek_char() {
@@ -1105,7 +1126,6 @@ pub fn parse_call_tail(s: &str, prefer_var: bool) -> Result<(CallExpr, usize)> {
))
}
-
/// Split a callee token into `(receiver, callee, lib path)`.
fn split_callee(callee_tok: &str) -> (Option, String, Option>) {
if let Some((r, m)) = split_method_callee(callee_tok) {
@@ -1180,7 +1200,13 @@ fn try_bracket_marked_call(s: &str, prefer_var: bool) -> Result