Skip to content

Commit 3f164a8

Browse files
committed
docs: clarify difference between markmap and options
1 parent 07a6808 commit 3f164a8

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ All frontmatter options are optional.
5555

5656
- **`id`** : Used to define the ID of the `markmap-wrap` element.
5757

58-
- **`markmap`**/**`options`** : Correspond to the [`IMarkmapJSONOptions`](https://markmap.js.org/api/interfaces/markmap-view.IMarkmapJSONOptions.html) in the markmap project. For more details, please refer to [`jsonOptions`](https://markmap.js.org/docs/json-options#option-list).
58+
- **`markmap`** : Correspond to the [`IMarkmapJSONOptions`](https://markmap.js.org/api/interfaces/markmap-view.IMarkmapJSONOptions.html) in the markmap project. For more details, please refer to [`jsonOptions`](https://markmap.js.org/docs/json-options#option-list).
59+
- alias: **`options`** (for backward compatibility)
60+
61+
> [!TIP]
62+
> **Difference between `markmap` and `options`**
63+
>
64+
> - **`markmap` (from markmap-lib)**
65+
> [Preprocesses](https://github.com/markmap/markmap/blob/master/packages/markmap-lib/src/plugins/frontmatter/index.ts#L41) JSON options (e.g., converting strings to arrays or numbers) and overrides the legacy `options`.
66+
> - For example, `color: 'red'` will be converted to `color: ['red']`, only the latter is valid in `markmap-view`.
67+
> - ✅ Recommended for consistent use with `markmap`.
68+
>
69+
> - **`options` (from markmap-universe)** Passed directly to markmap-view.
70+
> - ❌ Not recommended, maintained only for backward compatibility.
5971
6072

6173
#### Tag Options

README.zh.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,22 @@ markmap:
5151

5252
所有 frontmatter 选项都是可选的。
5353

54-
- **`id`** : 用于定义 `markmap-wrap` 元素的 ID。
54+
- **`id`**用于定义 `markmap-wrap` 元素的 ID。
5555

56-
- **`markmap`**/**`options`** : 对应 markmap 项目中 [`IMarkmapJSONOptions`](https://markmap.js.org/api/interfaces/markmap-view.IMarkmapJSONOptions.html)。有关更多详细信息,请参阅 [`jsonOptions`](https://markmap.js.org/docs/json-options#option-list).
56+
- **`markmap`**/**`options`**:对应 markmap 项目中的 [`IMarkmapJSONOptions`](https://markmap.js.org/api/interfaces/markmap-view.IMarkmapJSONOptions.html)。有关更多详细信息,请参考 [`jsonOptions`](https://markmap.js.org/docs/json-options#option-list)
57+
- 别名:**`options`**(向后兼容)
58+
59+
> [!TIP]
60+
> **`markmap``options` 的区别**
61+
>
62+
> - **`markmap`(来自 markmap-lib)**
63+
> JSON Options 会被[预处理](https://github.com/markmap/markmap/blob/master/packages/markmap-lib/src/plugins/frontmatter/index.ts#L41)(例如,将字符串转换为数组或数字),并优先覆盖 `options`
64+
> - 例如,`color: 'red'` 会被转换为 `color: ['red']`,只有后者在 `markmap-view` 中有效。
65+
> - ✅ 推荐使用,以保持与 `markmap` 一致。
66+
>
67+
> - **`options`(来自 markmap-universe)** 会被直接传递给 markmap-view。
68+
> - ❌ 不推荐使用,仅为向后兼容而保留。
69+
>
5770
5871
#### 标签选项
5972

0 commit comments

Comments
 (0)