remnote-bridge 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/README.zh-CN.md +13 -2
- package/dist/cli/commands/read-context.js +6 -4
- package/dist/cli/config.js +1 -1
- package/dist/cli/handlers/edit-handler.js +63 -16
- package/dist/cli/main.js +1 -1
- package/dist/cli/server/config-server.js +1 -1
- package/dist/mcp/instructions.js +29 -11
- package/dist/mcp/tools/edit-tools.js +10 -4
- package/dist/mcp/tools/read-tools.js +10 -5
- package/package.json +1 -1
- package/remnote-plugin/dist/index-sandbox.js +1 -1
- package/remnote-plugin/dist/index.js +1 -1
- package/remnote-plugin/src/services/read-context.ts +1 -1
- package/remnote-plugin/src/types.ts +59 -51
- package/skills/remnote-bridge/SKILL.md +17 -10
- package/skills/remnote-bridge/instructions/edit-rem.md +52 -16
- package/skills/remnote-bridge/instructions/edit-tree.md +22 -4
- package/skills/remnote-bridge/instructions/overall.md +37 -22
- package/skills/remnote-bridge/instructions/read-context.md +10 -5
- package/skills/remnote-bridge/instructions/read-rem.md +6 -6
- package/skills/remnote-bridge/instructions/read-tree.md +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# edit-tree
|
|
2
2
|
|
|
3
|
-
> 通过 str_replace 对 Markdown
|
|
3
|
+
> 通过 str_replace 对 Markdown 大纲进行结构编辑(行级增/删/移/重排),新增行支持 `{{文本}}` 填空语法,禁止修改已有行内容。
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
`edit-tree` 基于 `read-tree` 缓存的 Markdown 大纲,使用 str_replace 替换文本片段,解析新旧大纲的结构差异,自动生成并执行原子操作。
|
|
10
10
|
|
|
11
11
|
核心能力:
|
|
12
|
-
- **新增行**:在大纲中插入无 remId 的新行,支持 Markdown
|
|
12
|
+
- **新增行**:在大纲中插入无 remId 的新行,支持 Markdown 前缀、箭头分隔符、`{{文本}}` 填空语法
|
|
13
13
|
- **删除行**:从大纲中移除带 remId 的行(必须同时删除所有子行)
|
|
14
14
|
- **移动行**:改变行的缩进层级或移到不同父节点下
|
|
15
15
|
- **重排行**:调换同级行的顺序
|
|
16
16
|
- 三道防线保障数据安全(缓存存在性、乐观并发检测、精确匹配)
|
|
17
17
|
- SDK bug 自动修复(practiceDirection 保护)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**核心限制**:**禁止修改已有行的内容**(内容修改走 `edit-rem`)。新增行的内容格式不受此限,支持 Markdown 前缀、箭头、`{{文本}}` 填空等。
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -204,7 +204,7 @@ newStr: " 新增行\n {{idZ}}"
|
|
|
204
204
|
- `{{remId}}` 展开为**不含缩进**的完整行内容,缩进由你控制
|
|
205
205
|
- 只匹配纯字母数字(`[a-zA-Z0-9]+`),与 RemNote cloze 语法 `{{text}}` 不冲突
|
|
206
206
|
- 匹配到但不在缓存大纲中的 `{{xxx}}` 原样保留(可能是 cloze),并输出 templateWarnings
|
|
207
|
-
-
|
|
207
|
+
- 新增行不能用 `{{remId}}` 模板引用(没有 remId),但可以用 `{{文本}}` 创建填空卡片(两者不冲突:模板只匹配纯字母数字)
|
|
208
208
|
|
|
209
209
|
### 完整匹配模式(回退)
|
|
210
210
|
|
|
@@ -338,6 +338,22 @@ oldStr: " 子节点 A <!--idA-->"
|
|
|
338
338
|
newStr: " <!--portal refs:refId1,refId2-->\n 子节点 A <!--idA-->"
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
+
#### 完形填空新增行
|
|
342
|
+
|
|
343
|
+
在新增行内容中使用 `{{文本}}` 语法创建填空卡片。SDK 通过 `createSingleRemWithMarkdown` 自动生成唯一 cId,零碰撞风险。**这是创建填空的推荐方式**(优于 edit-rem 手动编造 cId)。
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
# 模板模式
|
|
347
|
+
oldStr: " {{idA}}"
|
|
348
|
+
newStr: " 水的化学式是{{H2O}}\n {{idA}}"
|
|
349
|
+
|
|
350
|
+
# 完整匹配模式
|
|
351
|
+
oldStr: " 子节点 A <!--idA-->"
|
|
352
|
+
newStr: " 法国的首都是{{巴黎}}\n 子节点 A <!--idA-->"
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
> 注意:`{{文本}}` 与模板引用 `{{remId}}` 不冲突——模板只匹配纯字母数字(`[a-zA-Z0-9]+`),中文/空格/标点不会被误匹配。
|
|
356
|
+
|
|
341
357
|
#### 嵌套新增
|
|
342
358
|
|
|
343
359
|
新增行下面可以再嵌套新增行,通过缩进表示父子关系:
|
|
@@ -435,6 +451,8 @@ newStr: " 子节点 C <!--idC-->\n 子节点 A <!--idA-->\n 子节点 B <!--i
|
|
|
435
451
|
| 缩进跳级 | `indent_skip` | 缩进跳级:行 ... 的缩进级别为 N,但找不到上一级的父节点。 | 检查缩进是否正确(每级 2 空格) |
|
|
436
452
|
| 新行劫持已有子节点 | `children_captured` | New line "..." accidentally captured existing children (...). | 把新行插到兄弟末尾,不要插在父 Rem 和 children 之间 |
|
|
437
453
|
|
|
454
|
+
> ⚠️ "修改已有行内容 → 使用 edit-rem"仅指**修改已存在 Rem 的文本**。创建含 `{{文本}}` 填空的**新行**应使用 edit-tree 的新增行功能,不要走 edit-rem 手动编造 cId。
|
|
455
|
+
|
|
438
456
|
---
|
|
439
457
|
|
|
440
458
|
## 操作执行顺序
|
|
@@ -91,6 +91,7 @@ Rem 有两个**独立维度**的类型:
|
|
|
91
91
|
| 创建反向问答 | `edit-tree` 新增行 `问题 ← 答案` |
|
|
92
92
|
| 创建双向问答 | `edit-tree` 新增行 `问题 ↔ 答案` |
|
|
93
93
|
| 创建多行答案 | `edit-tree` 新增行 `问题 ↓`(子行自动成为答案) |
|
|
94
|
+
| 创建完形填空 | `edit-tree` 新增行写 `水的化学式是{{H2O}}`(SDK 自动生成安全 cId,⚠️ **禁止**用 `edit-rem` 手动编造 cId) |
|
|
94
95
|
| 改变闪卡类型/方向 | `edit-rem` 修改 `type`、`backText`、`practiceDirection` |
|
|
95
96
|
|
|
96
97
|
`practiceDirection` 的取值:`forward`(正向)、`backward`(反向)、`both`(双向)、`none`(不练习)。
|
|
@@ -310,9 +311,10 @@ Agent 需要根据用户意图选择正确的读取命令:
|
|
|
310
311
|
│ 适合:首次探索、了解知识库组织
|
|
311
312
|
│
|
|
312
313
|
├─ 用户当前在看什么 → read-context
|
|
313
|
-
│ ├─
|
|
314
|
-
│ │
|
|
315
|
-
│ └─
|
|
314
|
+
│ ├─ page 模式(默认,推荐):以当前打开页面为根展开子树
|
|
315
|
+
│ │ 只需有打开的页面即可,几乎总能成功
|
|
316
|
+
│ └─ focus 模式(仅特定场景):以用户光标所在 Rem 为中心的鱼眼视图
|
|
317
|
+
│ 需用户光标停在某个 Rem 上,否则报错;仅当需要定位光标位置时使用
|
|
316
318
|
│
|
|
317
319
|
├─ 某个具体 Rem 的子树 → read-tree <remId>
|
|
318
320
|
│ 完整展开子树(支持深度/节点预算控制)
|
|
@@ -339,8 +341,8 @@ Agent 需要根据用户意图选择正确的读取命令:
|
|
|
339
341
|
| 场景 | 命令 | 输出特点 |
|
|
340
342
|
|:-----|:-----|:---------|
|
|
341
343
|
| "看看知识库有什么" | `read-globe` | 仅 Document 层级,无内容 Rem |
|
|
342
|
-
| "
|
|
343
|
-
| "
|
|
344
|
+
| "当前页面的内容" | `read-context` | 以页面为根展开(默认,推荐) |
|
|
345
|
+
| "我光标在哪" / "我正在编辑的 Rem" | `read-context --mode focus` | 鱼眼视图(需光标在某 Rem 上,否则报错) |
|
|
344
346
|
| "展开某个主题的细节" | `read-tree <id>` | 完整子树,可缓存供编辑 |
|
|
345
347
|
| "展开子树并查看每个节点属性" | `read-rem-in-tree <id>` | 大纲 + RemObject,双重缓存 |
|
|
346
348
|
|
|
@@ -354,18 +356,25 @@ Agent 需要根据用户意图选择正确的读取命令:
|
|
|
354
356
|
|
|
355
357
|
#### read-context 特性
|
|
356
358
|
|
|
357
|
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
- 焦点 Rem 前标记 `* ` 前缀
|
|
362
|
-
- 输出头部含 path 和 focus 信息
|
|
359
|
+
**模式选择指引**:
|
|
360
|
+
- **绝大多数场景用 page(默认)**——用户通常只是打开页面浏览,不会特意点击某个 Rem 让光标停在上面。page 只需有打开的页面就能工作,几乎总能成功
|
|
361
|
+
- **仅当需要定位用户光标时用 focus**——如用户说"我正在编辑的这个"、"光标所在的 Rem"。focus 要求光标停在某个 Rem 上,否则报错"当前没有聚焦的 Rem"
|
|
362
|
+
- **不确定时用 page**——最坏情况只是展开整个页面;focus 的最坏情况是报错
|
|
363
363
|
|
|
364
|
-
**page
|
|
364
|
+
**page 模式**(默认,推荐):
|
|
365
365
|
- 获取当前面板打开的页面 Rem
|
|
366
366
|
- 以该页面为根展开子树
|
|
367
367
|
- 参数:`depth`(默认 3)、`maxNodes`、`maxSiblings`
|
|
368
368
|
- 输出头部含 page 名和 breadcrumb path
|
|
369
|
+
- 前置条件宽松:只需有打开的页面
|
|
370
|
+
|
|
371
|
+
**focus 模式**(仅特定场景):
|
|
372
|
+
- 获取用户当前聚焦的 Rem(需要用户在 RemNote 中点击某个 Rem)
|
|
373
|
+
- 鱼眼视图展开策略:焦点 depth=3,焦点的 siblings depth=1,叔伯节点 depth=0
|
|
374
|
+
- 向上追溯 `ancestorLevels` 层(默认 2)
|
|
375
|
+
- 焦点 Rem 前标记 `* ` 前缀
|
|
376
|
+
- 输出头部含 path 和 focus 信息
|
|
377
|
+
- ⚠️ 前置条件严格:用户光标必须停在某个 Rem 上,否则报错
|
|
369
378
|
|
|
370
379
|
两者共同点:不缓存、Portal 感知、Powerup 噪音过滤、返回 breadcrumb。
|
|
371
380
|
|
|
@@ -581,8 +590,8 @@ Portal:portalType [R], portalDirectlyIncludedRem [Portal-W]
|
|
|
581
590
|
| `q` | `true` | 行内代码(红色等宽样式) |
|
|
582
591
|
| `code` | `true` | 代码块(带语言标签和复制按钮) |
|
|
583
592
|
| `language` | `string` | 代码块语言(如 `"javascript"`) |
|
|
584
|
-
| `cId` | `string` | 完形填空 ID |
|
|
585
|
-
| `hiddenCloze` | `true` |
|
|
593
|
+
| `cId` | `string` | 完形填空 ID(由 SDK 自动生成,禁止手动编造——创建填空用 `edit-tree` 的 `{{文本}}` 语法) |
|
|
594
|
+
| `hiddenCloze` | `true` | 完形填空隐藏状态(只读,RemNote 自动管理) |
|
|
586
595
|
| `iUrl` | `string` | 外部超链接 URL(`url` 字段已废弃,必须用 `iUrl`) |
|
|
587
596
|
| `qId` | `string` | 行内引用链接的 Rem ID |
|
|
588
597
|
|
|
@@ -595,7 +604,7 @@ Portal:portalType [R], portalDirectlyIncludedRem [Portal-W]
|
|
|
595
604
|
{ "i": "m", "q": true, "text": "code" } // 行内代码
|
|
596
605
|
{ "i": "m", "iUrl": "https://...", "text": "链接" } // 超链接
|
|
597
606
|
{ "b": true, "h": 1, "i": "m", "text": "重点" } // 粗体+红色高亮(h 是数字)
|
|
598
|
-
{ "cId": "
|
|
607
|
+
{ "cId": "4718093625140386", "i": "m", "text": "答案" } // 完形填空(cId 必须随机,禁止用 "c1" 等有语义命名)
|
|
599
608
|
{ "_id": "remId", "b": true, "i": "q" } // Rem 引用加粗(_id 排最前)
|
|
600
609
|
{ "i": "x", "text": "E = mc^2" } // LaTeX
|
|
601
610
|
{ "i": "a", "onlyAudio": false, "url": "..." } // 视频(onlyAudio 必填!)
|
|
@@ -613,7 +622,7 @@ Portal:portalType [R], portalDirectlyIncludedRem [Portal-W]
|
|
|
613
622
|
|
|
614
623
|
`h` 颜色值:0=无, 1=Red, 2=Orange, 3=Yellow, 4=Green, 5=Purple, 6=Blue, 7=Gray, 8=Brown, 9=Pink。
|
|
615
624
|
|
|
616
|
-
**序列化确定性**:RichText 对象内部按 key 字母序排列(`sortRichTextKeys()`)。`_id` 的 `_`(U+005F
|
|
625
|
+
**序列化确定性**:RichText 对象内部按 key 字母序排列(`sortRichTextKeys()`)。`_id` 的 `_`(U+005F)排在所有小写字母之前。这对语义并发检测和 edit-tree 的 str_replace 至关重要。
|
|
617
626
|
|
|
618
627
|
---
|
|
619
628
|
|
|
@@ -749,13 +758,18 @@ read-tree / read-globe / read-context 的输出核心是 Markdown 大纲文本
|
|
|
749
758
|
|
|
750
759
|
未缓存的 Rem 不允许编辑。确保 Agent 看到的数据和即将编辑的数据是同一份。
|
|
751
760
|
|
|
752
|
-
#### 防线 2
|
|
761
|
+
#### 防线 2:语义并发检测
|
|
753
762
|
|
|
754
763
|
```
|
|
755
|
-
edit 时重新从 SDK 读取最新数据 →
|
|
764
|
+
edit 时重新从 SDK 读取最新数据 → 只比较语义字段(内容、类型、格式、标签等)
|
|
756
765
|
```
|
|
757
766
|
|
|
758
|
-
|
|
767
|
+
将 RemObject 字段分为三层:
|
|
768
|
+
- **语义字段**(text, backText, type, tags, highlightColor, fontSize 等):变化 → 硬拒绝,迫使 Agent 重新 read
|
|
769
|
+
- **敏感元数据**(parent):变化 → 放行 + `"⚠️ parent has changed (was: oldId, now: newId). The Rem has been moved to a different parent since last read. Proceeding with edit."`
|
|
770
|
+
- **普通元数据**(positionAmongstSiblings, updatedAt, siblingRem, children, descendants 等):变化 → 放行 + `"ℹ️ Metadata fields changed since last read: {fields}. This is expected after structural operations. Proceeding with edit."`
|
|
771
|
+
|
|
772
|
+
这意味着 `edit-tree` 移动/重排 Rem 后,可以直接 `edit-rem` 修改受影响节点的文本格式,无需逐个重新 `read-rem`。只有真正的内容/属性并发冲突才会被拦截。
|
|
759
773
|
|
|
760
774
|
#### edit-rem 防线 3:字段白名单校验
|
|
761
775
|
|
|
@@ -781,7 +795,8 @@ oldStr 必须在目标文本中恰好匹配 1 次
|
|
|
781
795
|
| 场景 | 缓存行为 |
|
|
782
796
|
|:-----|:---------|
|
|
783
797
|
| 写入全部成功 | 从 SDK 重新读取最新状态 → **更新缓存** |
|
|
784
|
-
|
|
|
798
|
+
| 仅元数据变化(位置/时间戳等) | **静默刷新缓存并放行**(返回警告) |
|
|
799
|
+
| 语义字段冲突(内容/类型/格式等) | **不更新缓存**(迫使 Agent 重新 read) |
|
|
785
800
|
| 枚举值非法 | **报错拒绝**,不更新缓存 |
|
|
786
801
|
| 部分写入失败 | **不更新缓存** |
|
|
787
802
|
|
|
@@ -859,7 +874,7 @@ RemNote 的格式设置通过 Powerup 机制实现,会向 Rem 注入隐藏的
|
|
|
859
874
|
"readTreeAncestorLevels": 0,
|
|
860
875
|
"readTreeIncludePowerup": false,
|
|
861
876
|
"readGlobeDepth": -1,
|
|
862
|
-
"readContextMode": "
|
|
877
|
+
"readContextMode": "page",
|
|
863
878
|
"readContextAncestorLevels": 2,
|
|
864
879
|
"readContextDepth": 3,
|
|
865
880
|
"searchNumResults": 20
|
|
@@ -903,7 +918,7 @@ Agent 遇到错误时的诊断和恢复指南:
|
|
|
903
918
|
| 错误 | 原因 | 恢复 |
|
|
904
919
|
|:-----|:-----|:-----|
|
|
905
920
|
| has not been read yet | 未先执行 read-rem / read-tree | 执行对应 read 命令后重试 |
|
|
906
|
-
| has been modified since last read | Rem
|
|
921
|
+
| has been modified since last read | Rem 的语义字段在 read 和 edit 之间被外部修改 | 重新执行 read 获取最新状态后重试 |
|
|
907
922
|
|
|
908
923
|
### edit-tree str_replace 错误
|
|
909
924
|
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
`read-context` 根据用户在 RemNote 中的当前位置,生成上下文感知的 Markdown 大纲。两种模式适用于不同场景:
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
11
|
+
- **page 模式**(默认,推荐):以当前打开的页面 Rem 为根,均匀展开子树。只需有打开的页面即可,几乎总能成功
|
|
12
|
+
- **focus 模式**(仅特定场景):以当前焦点 Rem 为中心,向上追溯祖先,构建鱼眼视图——焦点完全展开,周围递减。需用户光标停在某个 Rem 上,否则报错
|
|
13
|
+
|
|
14
|
+
**何时用哪个模式**:
|
|
15
|
+
- 绝大多数场景用 page(默认)——用户通常只是打开页面浏览,不会特意让光标停在某个 Rem 上
|
|
16
|
+
- 仅当需要知道用户光标具体在哪个 Rem 上时才用 focus——如用户说"我正在编辑的这个"、"光标所在位置"
|
|
17
|
+
- 不确定时用 page——最坏情况只是展开整个页面;focus 的最坏情况是报错"当前没有聚焦的 Rem"
|
|
13
18
|
|
|
14
19
|
核心能力:
|
|
15
20
|
- 鱼眼深度梯度(focus 模式):焦点 depth=3、siblings depth=1、叔伯 depth=0
|
|
@@ -32,7 +37,7 @@ remnote-bridge read-context [--mode <mode>] [--ancestor-levels <N>] [--depth <N>
|
|
|
32
37
|
|
|
33
38
|
| 参数/选项 | 类型 | 必需 | 说明 |
|
|
34
39
|
|-----------|------|:----:|------|
|
|
35
|
-
| `--mode <mode>` | string | 否 | 模式:`
|
|
40
|
+
| `--mode <mode>` | string | 否 | 模式:`page`(默认)或 `focus` |
|
|
36
41
|
| `--ancestor-levels <N>` | integer | 否 | 向上追溯几层祖先(默认 2,仅 focus 模式) |
|
|
37
42
|
| `--depth <N>` | integer | 否 | 展开深度(默认 3,仅 page 模式) |
|
|
38
43
|
| `--max-nodes <N>` | integer | 否 | 全局节点上限(默认 200) |
|
|
@@ -84,7 +89,7 @@ remnote-bridge read-context --json '{"mode":"page","depth":5,"maxSiblings":10}'
|
|
|
84
89
|
|
|
85
90
|
| 字段 | 类型 | 必需 | 说明 |
|
|
86
91
|
|------|------|:----:|------|
|
|
87
|
-
| `mode` | string | 否 | 模式:`"
|
|
92
|
+
| `mode` | string | 否 | 模式:`"page"` 或 `"focus"`(默认 `"page"`) |
|
|
88
93
|
| `ancestorLevels` | number | 否 | 向上追溯几层祖先(默认 2,仅 focus 模式) |
|
|
89
94
|
| `depth` | number | 否 | 展开深度(默认 3,仅 page 模式) |
|
|
90
95
|
| `maxNodes` | number | 否 | 全局节点上限(默认 200) |
|
|
@@ -359,7 +364,7 @@ focus 模式的核心特点是**渐进式展开**——离焦点越近,展开
|
|
|
359
364
|
|
|
360
365
|
| 配置项 | 默认值 | 说明 |
|
|
361
366
|
|--------|--------|------|
|
|
362
|
-
| `defaults.readContextMode` | `"
|
|
367
|
+
| `defaults.readContextMode` | `"page"` | 默认模式 |
|
|
363
368
|
| `defaults.readContextAncestorLevels` | 2 | focus 模式默认祖先层数 |
|
|
364
369
|
| `defaults.readContextDepth` | 3 | page 模式默认展开深度 |
|
|
365
370
|
| `defaults.maxNodes` | 200 | 默认全局节点上限 |
|
|
@@ -182,7 +182,7 @@ RemObject 共 51 个字段,按读写权限分为三类:
|
|
|
182
182
|
|
|
183
183
|
| 字段 | 类型 | 权限 | 说明 |
|
|
184
184
|
|------|------|:----:|------|
|
|
185
|
-
| `text` | `RichText` | RW | 正面文本(RichText 数组)。UI
|
|
185
|
+
| `text` | `RichText` | RW | 正面文本(RichText 数组)。UI:文本内容立即更新显示。⚠️ 若含 cId 元素(完形填空),edit-rem 写回时须原样保留 cId 值 |
|
|
186
186
|
| `backText` | `RichText \| null` | RW | 背面文本。null=无背面;设值即产生闪卡正反面结构。UI:显示为"正面 → 背面"箭头分隔格式 |
|
|
187
187
|
|
|
188
188
|
### 类型系统
|
|
@@ -487,9 +487,9 @@ RemObject 中的 `text` 和 `backText` 字段使用 RichText 格式——一个
|
|
|
487
487
|
| `q` | `true` | 行内代码(红色等宽样式) |
|
|
488
488
|
| `code` | `true` | 代码块(带语言标签和复制按钮) |
|
|
489
489
|
| `language` | `string` | 代码块语言(如 `"javascript"`、`"python"`) |
|
|
490
|
-
| `cId` | `string` | 完形填空 ID |
|
|
491
|
-
| `hiddenCloze` | `true` |
|
|
492
|
-
| `revealedCloze` | `true` |
|
|
490
|
+
| `cId` | `string` | 完形填空 ID(由 SDK 自动生成,禁止手动编造——创建填空用 `edit-tree` 的 `{{文本}}` 语法。修改已有 cloze 时必须保留原 cId) |
|
|
491
|
+
| `hiddenCloze` | `true` | 完形填空隐藏状态(只读,RemNote 自动管理,禁止通过 edit-rem 写入) |
|
|
492
|
+
| `revealedCloze` | `true` | 完形填空已揭示状态(只读,RemNote 自动管理,禁止通过 edit-rem 写入) |
|
|
493
493
|
| `iUrl` | `string` | 外部超链接 URL(**注意**:`url` 字段已废弃无效,必须用 `iUrl`) |
|
|
494
494
|
| `qId` | `string` | 行内引用链接的 Rem ID |
|
|
495
495
|
|
|
@@ -532,9 +532,9 @@ RemObject 中的 `text` 和 `backText` 字段使用 RichText 格式——一个
|
|
|
532
532
|
"i": "m",
|
|
533
533
|
"text": "重点"
|
|
534
534
|
}
|
|
535
|
-
//
|
|
535
|
+
// 完形填空(⚠️ cId 由 SDK 自动生成。创建填空用 edit-tree {{文本}} 语法;edit-rem 仅修改已有 cloze,必须保留原 cId,禁止手动编造)
|
|
536
536
|
{
|
|
537
|
-
"cId": "
|
|
537
|
+
"cId": "8291740362058173",
|
|
538
538
|
"i": "m",
|
|
539
539
|
"text": "答案内容"
|
|
540
540
|
}
|
|
@@ -43,6 +43,7 @@ remnote-bridge read-tree <remId> [--depth N] [--max-nodes N] [--max-siblings N]
|
|
|
43
43
|
第一部分 <!--id1-->
|
|
44
44
|
小节 1.1 <!--id1_1-->
|
|
45
45
|
小节 1.2 → 答案 <!--id1_2-->
|
|
46
|
+
法国的首都是{{巴黎}} <!--id1_3-->
|
|
46
47
|
第二部分 <!--id2 children:5-->
|
|
47
48
|
```
|
|
48
49
|
|
|
@@ -159,7 +160,7 @@ read-tree 的核心输出是 Markdown 大纲文本。每一行对应一个 Rem
|
|
|
159
160
|
|
|
160
161
|
- **缩进**:每级 2 个空格(根节点 0 个空格)
|
|
161
162
|
- **Markdown 前缀**:映射 Rem 的格式属性
|
|
162
|
-
- **内容**:Rem 的 text 字段(已通过 SDK 转为 Markdown)
|
|
163
|
+
- **内容**:Rem 的 text 字段(已通过 SDK 转为 Markdown)。RichText 中的完形填空(cloze)元素渲染为 `{{文本}}`(如 `学习 {{Python}} 语言`)。cId 不在大纲中显示;创建新 cloze 用 `edit-tree` 新增行的 `{{文本}}` 语法(SDK 自动生成 cId)
|
|
163
164
|
- **箭头分隔符**:表示 practiceDirection(闪卡方向)
|
|
164
165
|
- **remId**:该行对应的 Rem ID
|
|
165
166
|
- **元数据标记**:空格分隔的属性标记
|
|
@@ -225,6 +226,7 @@ read-tree 的核心输出是 Markdown 大纲文本。每一行对应一个 Rem
|
|
|
225
226
|
# 数据结构 <!--kLr type:concept doc top-->
|
|
226
227
|
## 线性结构 <!--ABC type:concept-->
|
|
227
228
|
数组 → Array <!--DEF-->
|
|
229
|
+
{{二分查找}}的时间复杂度是 O(log n) <!--EFG-->
|
|
228
230
|
链表 ↓ <!--GHI type:concept-->
|
|
229
231
|
单向链表 <!--JKL role:card-item-->
|
|
230
232
|
双向链表 <!--MNO role:card-item-->
|