mn-docs-mcp 1.0.0 → 1.1.0

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.
Files changed (77) hide show
  1. package/.trae/documents/libmn_cleanup_plan.md +51 -0
  2. package/.trae/documents/libmn_doc_restructure_plan.md +140 -0
  3. package/.trae/documents/libmn_indentation_plan.md +116 -0
  4. package/.trae/documents/libmn_title_hierarchy_plan.md +91 -0
  5. package/README.md +9 -7
  6. package/next-env.d.ts +6 -0
  7. package/next.config.mjs +14 -0
  8. package/package.json +25 -10
  9. package/postcss.config.mjs +7 -0
  10. package/scripts/sync-definitions.mjs +33 -0
  11. package/source.config.ts +5 -0
  12. package/src/app/[[...slug]]/page.tsx +259 -0
  13. package/src/app/api/search/route.ts +6 -0
  14. package/src/app/global.css +81 -0
  15. package/src/app/layout.tsx +33 -0
  16. package/src/components/JsbApiFooter.tsx +251 -0
  17. package/src/content/docs/{guides/contributing.md → contributing.md} +27 -2
  18. package/src/content/docs/{guides/cookbook → cookbook}/addon-settings.md +2 -2
  19. package/src/content/docs/{guides/cookbook → cookbook}/embed-webview-panel.md +2 -2
  20. package/src/content/docs/cookbook/meta.json +13 -0
  21. package/src/content/docs/{guides/cookbook → cookbook}/network-api-call.md +2 -2
  22. package/src/content/docs/{guides/cookbook → cookbook}/webview-bidirectional-js.md +1 -1
  23. package/src/content/docs/guides/meta.json +14 -0
  24. package/src/content/docs/guides/mindmap-and-selection.md +1 -1
  25. package/src/content/docs/guides/native-ui.md +2 -2
  26. package/src/content/docs/guides/network-requests.md +1 -1
  27. package/src/content/docs/guides/notes-and-database.md +1 -1
  28. package/src/content/docs/guides/storage-and-files.md +1 -1
  29. package/src/content/docs/index.mdx +13 -38
  30. package/src/content/docs/libmn/data-converter.md +1572 -0
  31. package/src/content/docs/libmn/frame.md +279 -0
  32. package/src/content/docs/libmn/headers.md +234 -0
  33. package/src/content/docs/libmn/index.md +60 -0
  34. package/src/content/docs/libmn/internal-exposed.md +46 -0
  35. package/src/content/docs/libmn/locale.md +307 -0
  36. package/src/content/docs/libmn/menu.md +77 -0
  37. package/src/content/docs/libmn/meta.json +27 -0
  38. package/src/content/docs/libmn/mnbutton.md +966 -0
  39. package/src/content/docs/libmn/mncomment.md +533 -0
  40. package/src/content/docs/libmn/mnconnection.md +717 -0
  41. package/src/content/docs/libmn/mndocument.md +309 -0
  42. package/src/content/docs/libmn/mnextension-panel.md +340 -0
  43. package/src/content/docs/libmn/mnnote.md +533 -0
  44. package/src/content/docs/libmn/mnnotebook.md +725 -0
  45. package/src/content/docs/libmn/mnutil.md +2936 -0
  46. package/src/content/docs/libmn/mnwebview.md +693 -0
  47. package/src/content/docs/libmn/mustache.md +65 -0
  48. package/src/content/docs/libmn/response.md +352 -0
  49. package/src/content/docs/libmn/runtime-assets.md +64 -0
  50. package/src/content/docs/libmn/runtime-web-view-host.md +77 -0
  51. package/src/content/docs/libmn/runtime.md +178 -0
  52. package/src/content/docs/libmn/vendor-globals.md +34 -0
  53. package/src/content/docs/meta.json +11 -0
  54. package/src/content/docs/reference/foundation/meta.json +4 -0
  55. package/src/content/docs/reference/foundation/ns-user-defaults.md +1 -1
  56. package/src/content/docs/reference/global/meta.json +18 -0
  57. package/src/content/docs/reference/marginnote/mb-book-note.md +50 -53
  58. package/src/content/docs/reference/marginnote/meta.json +18 -0
  59. package/src/content/docs/reference/marginnote/study-controller.md +17 -17
  60. package/src/content/docs/reference/meta.json +14 -0
  61. package/src/content/docs/reference/quartzcore/meta.json +4 -0
  62. package/src/content/docs/reference/uikit/meta.json +4 -0
  63. package/src/content/docs/reference/uikit/uiwebview.md +2 -2
  64. package/src/content/docs/reference/utility/meta.json +4 -0
  65. package/src/lib/layout.tsx +31 -0
  66. package/src/lib/source.ts +7 -0
  67. package/tsconfig.json +42 -3
  68. package/astro.config.mjs +0 -130
  69. package/src/client/jsb-api-footer.ts +0 -242
  70. package/src/components/Footer.astro +0 -57
  71. package/src/components/Search.astro +0 -330
  72. package/src/content.config.ts +0 -7
  73. package/src/styles/starlight-overrides.css +0 -23
  74. /package/src/content/docs/{guides/cookbook → cookbook}/append-selection-as-comment.md +0 -0
  75. /package/src/content/docs/{guides/cookbook → cookbook}/batch-rename-notes.md +0 -0
  76. /package/src/content/docs/{guides/cookbook → cookbook}/export-notebook.md +0 -0
  77. /package/src/content/docs/{guides/cookbook → cookbook}/focus-note-in-mindmap.md +0 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: LibMN Vendor Globals
3
+ description: LibMN加载后可用的第三方全局对象与库内真实调用点。
4
+ ---
5
+
6
+ LibMN会在启动阶段加载一组第三方库并把全局对象暴露到JSContext。这里的重点不是重复上游全部API,而是告诉你“LibMN当前实际依赖了哪些能力”。
7
+
8
+ ## 第三方全局对象清单
9
+
10
+ | 全局对象 | 来源模块 | LibMN已使用能力 | 官方文档 |
11
+ |:---|:---|:---|:---|
12
+ | `CryptoJS` | `vendor/CryptoJS` | `AES.encrypt/decrypt`、`MD5`、`SHA256`、`enc.Base64`、`enc.Utf8`、`lib.WordArray.create` | [CryptoJS](https://github.com/brix/crypto-js) |
13
+ | `marked` | `vendor/marked` | `marked.parse`、`marked.lexer` | [Marked](https://marked.js.org/) |
14
+ | `mustache` | `vendor/mustache` | `mustache.render`、`mustache.parse` | [mustache.js](https://github.com/janl/mustache.js) |
15
+ | `Segmentit` | `vendor/segmentit` | `Segmentit.useDefault`、`Segmentit.Segment` | [Segmentit](https://github.com/linonetwo/segmentit) |
16
+ | `jsonrepair` | `vendor/jsonrepair` | `jsonrepair(...)` | [jsonrepair](https://github.com/josdejong/jsonrepair) |
17
+ | `pako` | `vendor/pako` | `pako.gzip`、`pako.ungzip` | [pako](https://github.com/nodeca/pako) |
18
+ | `LZString` | `vendor/lz-string` | `compressToBase64`、`decompressFromBase64` | [LZString](https://pieroxy.net/blog/pages/lz-string/index.html) |
19
+ | `PDFTools` | `vendor/pdf-bridge-core` | `convertImageBase64ToPdfBase64`、`extractPage` | [AddonLib仓库](https://github.com/Temsys-Shen/marginnote-addon-docs) |
20
+
21
+ ## 依赖策略建议
22
+
23
+ - 你的业务代码若直接调用这些全局对象,等于直接承担第三方升级风险。
24
+ - 若LibMN中已有对应封装,优先走`MNUtil`或相关包装类,避免把业务和vendor细节绑死。
25
+ - 只有在封装能力不足时再直接访问vendor全局,并在插件内注明版本假设。
26
+
27
+ ## 常见误区
28
+
29
+ - 误区1:把vendor全局当成LibMN稳定API。
30
+ 说明:它们的稳定性由上游库决定,不由LibMN承诺。
31
+ - 误区2:忽略二进制和编码边界。
32
+ 说明:涉及Base64、压缩、PDF转换时,优先复用`DataConverter`和`MNUtil`现成通路。
33
+ - 误区3:只看单次调用成功就上线。
34
+ 说明:应在不同文档类型、不同笔记本规模下做回归验证。
@@ -0,0 +1,11 @@
1
+ {
2
+ "title": "MarginNote插件开发文档",
3
+ "pages": [
4
+ "index",
5
+ "guides",
6
+ "cookbook",
7
+ "reference",
8
+ "libmn",
9
+ "contributing"
10
+ ]
11
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "Foundation",
3
+ "pages": ["..."]
4
+ }
@@ -299,4 +299,4 @@ registerDefaults(registrationDictionary: NSDictionary): void
299
299
 
300
300
  ## 相关
301
301
 
302
- - [教程:存储与文件](/guides/storage-and-files/)、[Cookbook:插件设置页](/guides/cookbook/addon-settings/)
302
+ - [教程:存储与文件](/guides/storage-and-files/)、[Cookbook:插件设置页](/cookbook/addon-settings/)
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "全局与入口",
3
+ "pages": [
4
+ "global-variables",
5
+ "jsb",
6
+ "application",
7
+ "search-manager",
8
+ "database",
9
+ "document",
10
+ "notebook",
11
+ "note",
12
+ "agent-tools",
13
+ "popup-menu",
14
+ "popup-menu-item",
15
+ "self",
16
+ "builtin-commands"
17
+ ]
18
+ }
@@ -2,46 +2,45 @@
2
2
  title: MbBookNote
3
3
  description: 笔记核心对象,代表脑图中的一条笔记及其摘录、评论、链接与层级。
4
4
  ---
5
-
6
5
  插件开发中最核心的数据对象,代表一条笔记(脑图节点)。可通过 [Database.getNoteById](/reference/global/database/)、[NotebookController.focusNote](/reference/marginnote/notebook-controller/)、[MindMapNode.note](/reference/marginnote/mindmap-node/) 等获取。修改后使用 [UndoManager.undoGrouping](/reference/utility/undo-manager/) 包裹并刷新界面。
7
6
 
8
7
  ## 实例成员 (Instance members)
9
8
 
10
9
  ### 可读写属性
11
10
 
12
- | 属性 | 类型 | 说明 |
13
- | :--- | :--- | :--- |
14
- | `noteTitle` | `string` | 笔记标题。 |
15
- | `excerptText` | `string` | 摘录文本。 |
11
+ | 属性 | 类型 | 说明 |
12
+ | :---------------------- | :--------- | :-------------------------------------------- |
13
+ | `noteTitle` | `string` | 笔记标题。 |
14
+ | `excerptText` | `string` | 摘录文本。 |
16
15
  | `excerptTextMarkdown` | `number` | 摘录文本是否为 Markdown(接口字段,为 0/1)。 |
17
- | `colorIndex` | `number` | 颜色索引 (0–15)。 |
18
- | `fillIndex` | `number` | 填充类型。 |
16
+ | `colorIndex` | `number` | 颜色索引 (0–15)。 |
17
+ | `fillIndex` | `number` | 填充类型。 |
19
18
 
20
19
  ### 只读属性
21
20
 
22
- | 属性 | 类型 | 说明 |
23
- | :--- | :--- | :--- |
24
- | `noteId` | `string` | 笔记唯一 ID。 |
25
- | `docMd5` | `string` | 来源文档 MD5。 |
26
- | `notebookId` | `string` | 所属笔记本 ID。 |
27
- | `startPage` / `endPage` | `NSNumber` | 摘录起止页码。 |
28
- | `startPos` / `endPos` | `string` | 摘录起止位置。 |
29
- | `excerptPic` | `NSDictionary` | 摘录图片信息。 |
30
- | `createDate` / `modifiedDate` | `NSDate` | 创建/修改时间。 |
31
- | `mediaList` | `string` | 媒体列表。 |
32
- | `originNoteId` | `string` | 原始笔记 ID(如 Evernote)。 |
33
- | `mindmapBranchClose` | `NSNumber` | 脑图分支是否折叠。 |
34
- | `notesText` | `string` | 笔记文本聚合。 |
35
- | `groupNoteId` | `string` | 分组笔记 ID。 |
36
- | `comments` | `NSArray` | 评论数组,元素为 [NoteComment](/reference/marginnote/note-comment/) 结构。 |
37
- | `parentNote` | `MbBookNote` \| undefined | 父笔记。 |
38
- | `childMindMap` | `MbBookNote` \| undefined | 子脑图。 |
39
- | `linkedNotes` | `NSArray` | 链接的笔记。 |
40
- | `childNotes` | `NSArray` | 子笔记数组。 |
41
- | `summaryLinks` | `NSArray` | 摘要链接。 |
42
- | `zLevel` / `hidden` / `toc` / `annotation` / `textFirst` / `groupMode` / `flashcard` / `flagged` | `NSNumber` | 各类标志。 |
43
- | `summary` | `boolean` | 是否有摘要链接。 |
44
- | `textHighlight` / `options` | `NSDictionary` | 文本高亮与选项。 |
21
+ | 属性 | 类型 | 说明 |
22
+ | :--------------------------------------------------------------------------------------------------------------- | :-------------------------- | :--------------------------------------------------------------------- |
23
+ | `noteId` | `string` | 笔记唯一 ID。 |
24
+ | `docMd5` | `string` | 来源文档 MD5。 |
25
+ | `notebookId` | `string` | 所属笔记本 ID。 |
26
+ | `startPage` / `endPage` | `NSNumber` | 摘录起止页码。 |
27
+ | `startPos` / `endPos` | `string` | 摘录起止位置。 |
28
+ | `excerptPic` | `NSDictionary` | 摘录图片信息。 |
29
+ | `createDate` / `modifiedDate` | `NSDate` | 创建/修改时间。 |
30
+ | `mediaList` | `string` | 媒体列表。 |
31
+ | `originNoteId` | `string` | 原始笔记 ID(如 Evernote)。 |
32
+ | `mindmapBranchClose` | `NSNumber` | 脑图分支是否折叠。 |
33
+ | `notesText` | `string` | 笔记文本聚合。 |
34
+ | `groupNoteId` | `string` | 分组笔记 ID。 |
35
+ | `comments` | `NSArray` | 评论数组,元素为[NoteComment](/reference/marginnote/note-comment/) 结构。 |
36
+ | `parentNote` | `MbBookNote` \| undefined | 父笔记。 |
37
+ | `childMindMap` | `MbBookNote` \| undefined | 子脑图。 |
38
+ | `linkedNotes` | `NSArray` | 链接的笔记。 |
39
+ | `childNotes` | `NSArray` | 子笔记数组。 |
40
+ | `summaryLinks` | `NSArray` | 摘要链接。 |
41
+ | `zLevel` / `hidden` / `toc` / `annotation` / `textFirst` / `groupMode` / `flashcard` / `flagged` | `NSNumber` | 各类标志。 |
42
+ | `summary` | `boolean` | 是否有摘要链接。 |
43
+ | `textHighlight` / `options` | `NSDictionary` | 文本高亮与选项。 |
45
44
 
46
45
  ### 实例方法
47
46
 
@@ -55,9 +54,9 @@ appendTextComment(text: string): void
55
54
 
56
55
  **Parameters:**
57
56
 
58
- | Name | Type | Description |
59
- | :--- | :--- | :--- |
60
- | `text` | `string` | 评论内容。 |
57
+ | Name | Type | Description |
58
+ | :------- | :--------- | :---------- |
59
+ | `text` | `string` | 评论内容。 |
61
60
 
62
61
  #### `appendMarkdownComment`
63
62
 
@@ -69,8 +68,8 @@ appendMarkdownComment(text: string): void
69
68
 
70
69
  **Parameters:**
71
70
 
72
- | Name | Type | Description |
73
- | :--- | :--- | :--- |
71
+ | Name | Type | Description |
72
+ | :------- | :--------- | :------------------------ |
74
73
  | `text` | `string` | Markdown 格式的评论内容。 |
75
74
 
76
75
  #### `appendNoteLink`
@@ -83,8 +82,8 @@ appendNoteLink(note: MbBookNote): void
83
82
 
84
83
  **Parameters:**
85
84
 
86
- | Name | Type | Description |
87
- | :--- | :--- | :--- |
85
+ | Name | Type | Description |
86
+ | :------- | :------------- | :------------- |
88
87
  | `note` | `MbBookNote` | 目标笔记对象。 |
89
88
 
90
89
  **说明**:会在 `comments` 数组中添加一条 `TextNote` 类型的评论,`text` 字段存储格式为 `marginnote4app://note/{noteId}`。
@@ -102,21 +101,19 @@ merge(note: MbBookNote): void
102
101
  添加 HTML 评论。
103
102
 
104
103
  ```javascript
105
- appendHtmlComment(html: string, text: string, size: [CGSize](/reference/value-sturct/#cgsize), tag: string): void
104
+ appendHtmlComment(html: string, text: string, size: CGSize, tag: string): void
106
105
  ```
107
106
 
108
- 其中`size`类型见[`CGSize`](/reference/value-sturct/#cgsize)。
107
+ 其中 `size`类型见[`CGSize`](/reference/value-sturct/#cgsize)。
109
108
 
110
109
  **Parameters:**
111
110
 
112
- | Name | Type | Description |
113
- | :--- | :--- | :--- |
114
- | `html` | `string` | HTML 内容。 |
115
- | `text` | `string` | 纯文本内容(用于搜索等)。 |
116
- | `size` | [`CGSize`](/reference/value-sturct/#cgsize) | 渲染尺寸。 |
117
- | `tag` | `string` | 标签标识。 |
118
-
119
- **说明**:此方法已废弃,HTML 评论不再单独存储,使用 `appendMarkdownComment` 替代。
111
+ | Name | Type | Description |
112
+ | :------- | :----------------------------------------- | :------------------------- |
113
+ | `html` | `string` | HTML 内容。 |
114
+ | `text` | `string` | 纯文本内容(用于搜索等)。 |
115
+ | `size` | [`CGSize`](/reference/value-sturct/#cgsize) | 渲染尺寸。 |
116
+ | `tag` | `string` | 标签标识。 |
120
117
 
121
118
  #### `removeCommentByIndex`
122
119
 
@@ -128,8 +125,8 @@ removeCommentByIndex(index: number): void
128
125
 
129
126
  **Parameters:**
130
127
 
131
- | Name | Type | Description |
132
- | :--- | :--- | :--- |
128
+ | Name | Type | Description |
129
+ | :-------- | :--------- | :--------------------------------- |
133
130
  | `index` | `number` | 评论在 `comments` 数组中的索引。 |
134
131
 
135
132
  #### `clearFormat`
@@ -186,7 +183,7 @@ addChild(note: MbBookNote): void
186
183
 
187
184
  #### `sortCommentsByNewIndices`
188
185
 
189
- 按新索引数组重排`comments`。
186
+ 按新索引数组重排 `comments`。
190
187
 
191
188
  ```javascript
192
189
  sortCommentsByNewIndices(newIndices: NSArray): void
@@ -208,7 +205,7 @@ processMarkdownBase64Images(): boolean
208
205
 
209
206
  **定义:**
210
207
 
211
- 处理当前笔记中符合条件的Markdown文本里的`data:image...base64`图片引用。
208
+ 处理当前笔记中符合条件的Markdown文本里的 `data:image...base64`图片引用。
212
209
 
213
210
  **返回:**
214
211
 
@@ -223,7 +220,7 @@ processMarkdownBase64Images(): boolean
223
220
  **副作用:**
224
221
 
225
222
  - 会改写笔记内容相关字段。
226
- - 会更新`mediaList`。
223
+ - 会更新 `mediaList`。
227
224
  - 会更新笔记修改时间。
228
225
 
229
226
  **最小验证:**
@@ -267,7 +264,7 @@ getStrokesCount(): NSInteger
267
264
 
268
265
  ### `createWithTitleNotebookDocument`
269
266
 
270
- 创建新笔记类方法。在JS侧默认通过全局注入的`Note`对象调用同名方法。
267
+ 创建新笔记类方法。在JS侧默认通过全局注入的 `Note`对象调用同名方法。
271
268
 
272
269
  ```javascript
273
270
  static createWithTitleNotebookDocument(title: string, notebook: MbTopic, document: MbBook): MbBookNote
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "MarginNote核心",
3
+ "pages": [
4
+ "jsextension",
5
+ "study-controller",
6
+ "notebook-controller",
7
+ "reader-controller",
8
+ "document-controller",
9
+ "mindmap-view",
10
+ "outline-view",
11
+ "mindmap-node",
12
+ "mb-book-note",
13
+ "note-comment",
14
+ "mb-topic",
15
+ "mb-book",
16
+ "mb-model-tool"
17
+ ]
18
+ }
@@ -2,23 +2,23 @@
2
2
  title: StudyController
3
3
  description: 学习场景主视图控制器,访问脑图与文档的入口。
4
4
  ---
5
-
6
5
  学习场景的主视图控制器,通过 `Application.sharedInstance().studyController(window)` 获取(默认传入 `self.window`)。是访问脑图、文档、当前笔记本等的根对象。
7
6
 
8
7
  ## 实例成员 (Instance members)
9
8
 
10
9
  ### 属性(只读)
11
10
 
12
- | 属性 | 类型 | 说明 |
13
- | :--- | :--- | :--- |
14
- | `view` | `UIView` | 控制器主视图,可在此添加插件 UI。 |
15
- | `notebookController` | `NotebookController` | 脑图/大纲控制器。 |
16
- | `readerController` | `ReaderController` | 文档阅读区域控制器。 |
17
- | `studyMode` | `number` | 当前学习模式:0/1 文档模式,2 学习模式,3 复习模式。 |
18
- | `narrowMode` | `boolean` | 是否窄屏模式(窄屏下书本分屏模式 1 不可用)。 |
19
- | `docMapSplitMode` | `number` | 书本/脑图分屏模式:0 全脑图,1 半脑图半文档,2 全文档。 |
20
- | `rightMapMode` | `boolean` | 脑图是否在右侧。 |
21
- | `extensionPanelController` | `UIViewController` | 扩展面板控制器。 |
11
+ | 属性 | 类型 | 说明 |
12
+ | :--------------------------- | :--------------------- | :------------------------------------------------------ |
13
+ | `view` | `UIView` | 控制器主视图,可在此添加插件 UI。 |
14
+ | `notebookController` | `NotebookController` | 脑图/大纲控制器。 |
15
+ | `readerController` | `ReaderController` | 文档阅读区域控制器。 |
16
+ | `studyMode` | `number` | 当前学习模式:0/1 文档模式,2 学习模式,3 复习模式。 |
17
+ | `narrowMode` | `boolean` | 是否窄屏模式(窄屏下书本分屏模式 1 不可用)。 |
18
+ | `docMapSplitMode` | `number` | 书本/脑图分屏模式:0 全脑图,1 半脑图半文档,2 全文档。 |
19
+ | `rightMapMode` | `boolean` | 脑图是否在右侧。 |
20
+ | `extensionPanelController` | `UIViewController` | 扩展面板控制器。 |
21
+ | `immersiveMode` | `boolean` | 是否处于沉浸模式 |
22
22
 
23
23
  ### 方法
24
24
 
@@ -32,9 +32,9 @@ focusNoteInMindMapById(noteId: string): void
32
32
 
33
33
  **Parameters:**
34
34
 
35
- | Name | Type | Description |
36
- | :--- | :--- | :--- |
37
- | `noteId` | `string` | 笔记 ID。 |
35
+ | Name | Type | Description |
36
+ | :--------- | :--------- | :---------- |
37
+ | `noteId` | `string` | 笔记 ID。 |
38
38
 
39
39
  ### `focusNoteInDocumentById`
40
40
 
@@ -46,9 +46,9 @@ focusNoteInDocumentById(noteId: string): void
46
46
 
47
47
  **Parameters:**
48
48
 
49
- | Name | Type | Description |
50
- | :--- | :--- | :--- |
51
- | `noteId` | `string` | 笔记 ID。 |
49
+ | Name | Type | Description |
50
+ | :--------- | :--------- | :---------- |
51
+ | `noteId` | `string` | 笔记 ID。 |
52
52
 
53
53
  ### `refreshAddonCommands`
54
54
 
@@ -0,0 +1,14 @@
1
+ {
2
+ "title": "API参考",
3
+ "pages": [
4
+ "global",
5
+ "marginnote",
6
+ "foundation",
7
+ "uikit",
8
+ "quartzcore",
9
+ "utility",
10
+ "js-runtime",
11
+ "value-sturct",
12
+ "black-box"
13
+ ]
14
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "QuartzCore",
3
+ "pages": ["..."]
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "UIKit",
3
+ "pages": ["..."]
4
+ }
@@ -3,7 +3,7 @@ title: UIWebView
3
3
  description: 在插件中嵌入网页或本地 HTML,支持加载 URL、执行 JS 与 delegate 回调。
4
4
  ---
5
5
 
6
- UIWebView 用于在插件中嵌入网页或本地 HTML 页面,继承自 [UIView](/reference/uikit/uiview/)。可通过设置 `delegate` 接收加载开始/完成/失败与请求拦截(如自定义 URL Scheme 实现 WebView 内 JS 与插件 JS 的双向通信)。参见 [Cookbook:WebView 内 JS 与插件 JS 双向通信](/guides/cookbook/webview-bidirectional-js/)。
6
+ UIWebView 用于在插件中嵌入网页或本地 HTML 页面,继承自 [UIView](/reference/uikit/uiview/)。可通过设置 `delegate` 接收加载开始/完成/失败与请求拦截(如自定义 URL Scheme 实现 WebView 内 JS 与插件 JS 的双向通信)。参见 [Cookbook:WebView 内 JS 与插件 JS 双向通信](/cookbook/webview-bidirectional-js/)。
7
7
 
8
8
  ## 实例成员 (Instance members)
9
9
 
@@ -225,5 +225,5 @@ webViewShouldStartLoadWithRequestNavigationType(webView: UIWebView, request: NSU
225
225
 
226
226
  ## 相关
227
227
 
228
- - [原生 UI:使用 WebView](/guides/native-ui/#使用-webview)、[Cookbook:WebView 内 JS 与插件 JS 双向通信](/guides/cookbook/webview-bidirectional-js/)
228
+ - [原生 UI:使用 WebView](/guides/native-ui/#使用-webview)、[Cookbook:WebView 内 JS 与插件 JS 双向通信](/cookbook/webview-bidirectional-js/)
229
229
  - [UIView](/reference/uikit/uiview/)、[UIViewController](/reference/uikit/uiview-controller/)
@@ -0,0 +1,4 @@
1
+ {
2
+ "title": "Utility",
3
+ "pages": ["..."]
4
+ }
@@ -0,0 +1,31 @@
1
+ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'
2
+
3
+ export const baseOptions: BaseLayoutProps = {
4
+ nav: {
5
+ title: 'MarginNote 插件开发文档',
6
+ },
7
+ links: [
8
+ { text: '首页', url: '/', active: 'url' },
9
+ {
10
+ text: '教程',
11
+ url: '/guides/getting-started/',
12
+ active: 'nested-url',
13
+ },
14
+ {
15
+ text: 'Cookbook',
16
+ url: '/cookbook/batch-rename-notes/',
17
+ active: 'nested-url',
18
+ },
19
+ {
20
+ text: 'API 参考',
21
+ url: '/reference/global/jsb/',
22
+ active: 'nested-url',
23
+ },
24
+ { text: 'LibMN', url: '/libmn/', active: 'nested-url' },
25
+ {
26
+ text: '贡献指南',
27
+ url: '/contributing/',
28
+ active: 'nested-url',
29
+ },
30
+ ],
31
+ }
@@ -0,0 +1,7 @@
1
+ import { docs } from '@/.source/server';
2
+ import { loader } from 'fumadocs-core/source';
3
+
4
+ export const source = loader({
5
+ baseUrl: '',
6
+ source: docs.toFumadocsSource(),
7
+ });
package/tsconfig.json CHANGED
@@ -1,5 +1,44 @@
1
1
  {
2
- "extends": "astro/tsconfigs/strict",
3
- "include": [".astro/types.d.ts", "**/*"],
4
- "exclude": ["dist"]
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "es2022"
8
+ ],
9
+ "allowJs": true,
10
+ "skipLibCheck": true,
11
+ "strict": true,
12
+ "noEmit": true,
13
+ "esModuleInterop": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "bundler",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "jsx": "react-jsx",
19
+ "incremental": true,
20
+ "plugins": [
21
+ {
22
+ "name": "next"
23
+ }
24
+ ],
25
+ "paths": {
26
+ "@/*": [
27
+ "./*"
28
+ ]
29
+ }
30
+ },
31
+ "include": [
32
+ "next-env.d.ts",
33
+ "**/*.ts",
34
+ "**/*.tsx",
35
+ ".next/types/**/*.ts",
36
+ ".source/**/*",
37
+ ".next/dev/types/**/*.ts"
38
+ ],
39
+ "exclude": [
40
+ "node_modules",
41
+ "out",
42
+ "dist"
43
+ ]
5
44
  }
package/astro.config.mjs DELETED
@@ -1,130 +0,0 @@
1
- // @ts-check
2
- import { defineConfig } from 'astro/config';
3
- import starlight from '@astrojs/starlight';
4
-
5
- // https://astro.build/config
6
- export default defineConfig({
7
- site: 'https://mn-docs.museday.top',
8
- integrations: [
9
- starlight({
10
- title: 'MarginNote 插件开发文档',
11
- customCss: ['/src/styles/starlight-overrides.css'],
12
- components: {
13
- Search: './src/components/Search.astro',
14
- Footer: './src/components/Footer.astro',
15
- },
16
- social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/Temsys-Shen/marginnote-addon-docs' }],
17
- sidebar: [
18
- {
19
- label: '入门',
20
- items: [
21
- { label: '快速开始', slug: 'guides/getting-started' },
22
- ],
23
- },
24
- {
25
- label: '教程与 Cookbook',
26
- items: [
27
- { label: '生命周期与窗口', slug: 'guides/lifecycle-and-window' },
28
- { label: '笔记与数据库', slug: 'guides/notes-and-database' },
29
- { label: '脑图与选区', slug: 'guides/mindmap-and-selection' },
30
- { label: '工具栏与命令', slug: 'guides/toolbar-and-commands' },
31
- { label: '快捷键', slug: 'guides/shortcut-keys' },
32
- { label: '原生 UI', slug: 'guides/native-ui' },
33
- { label: '存储与文件', slug: 'guides/storage-and-files' },
34
- { label: '网络请求', slug: 'guides/network-requests' },
35
- {
36
- label: 'Cookbook 配方',
37
- items: [
38
- { label: '批量修改笔记标题', slug: 'guides/cookbook/batch-rename-notes' },
39
- { label: '调用远程 API', slug: 'guides/cookbook/network-api-call' },
40
- { label: '导出当前笔记本', slug: 'guides/cookbook/export-notebook' },
41
- { label: '在脑图中高亮指定笔记', slug: 'guides/cookbook/focus-note-in-mindmap' },
42
- { label: '将选区追加为评论', slug: 'guides/cookbook/append-selection-as-comment' },
43
- { label: '插件设置页', slug: 'guides/cookbook/addon-settings' },
44
- { label: '在插件中嵌入 WebView 面板', slug: 'guides/cookbook/embed-webview-panel' },
45
- { label: 'WebView 内 JS 与插件 JS 双向通信', slug: 'guides/cookbook/webview-bidirectional-js' },
46
- ],
47
- },
48
- ],
49
- },
50
- {
51
- label: 'API 参考',
52
- items: [
53
- {
54
- label: '全局与入口',
55
- items: [
56
- { label: '全局入口对象', slug: 'reference/global/global-variables' },
57
- { label: 'JSB', slug: 'reference/global/jsb' },
58
- { label: 'Application', slug: 'reference/global/application' },
59
- { label: 'SearchManager', slug: 'reference/global/search-manager' },
60
- { label: 'Database', slug: 'reference/global/database' },
61
- { label: 'Document', slug: 'reference/global/document' },
62
- { label: 'Notebook', slug: 'reference/global/notebook' },
63
- { label: 'Note', slug: 'reference/global/note' },
64
- { label: 'AgentTools', slug: 'reference/global/agent-tools' },
65
- { label: 'PopupMenu', slug: 'reference/global/popup-menu' },
66
- { label: 'PopupMenuItem', slug: 'reference/global/popup-menu-item' },
67
- { label: 'self', slug: 'reference/global/self' },
68
- ],
69
- },
70
- {
71
- label: 'MarginNote 核心',
72
- items: [
73
- { label: 'JSExtension', slug: 'reference/marginnote/jsextension' },
74
- { label: 'StudyController', slug: 'reference/marginnote/study-controller' },
75
- { label: 'NotebookController', slug: 'reference/marginnote/notebook-controller' },
76
- { label: 'ReaderController', slug: 'reference/marginnote/reader-controller' },
77
- { label: 'DocumentController', slug: 'reference/marginnote/document-controller' },
78
- { label: 'MindMapView', slug: 'reference/marginnote/mindmap-view' },
79
- { label: 'OutlineView', slug: 'reference/marginnote/outline-view' },
80
- { label: 'MindMapNode', slug: 'reference/marginnote/mindmap-node' },
81
- { label: 'MbBookNote', slug: 'reference/marginnote/mb-book-note' },
82
- { label: 'NoteComment', slug: 'reference/marginnote/note-comment' },
83
- { label: 'MbTopic', slug: 'reference/marginnote/mb-topic' },
84
- { label: 'MbBook', slug: 'reference/marginnote/mb-book' },
85
- { label: 'MbModelTool', slug: 'reference/marginnote/mb-model-tool' },
86
- ],
87
- },
88
- {
89
- label: 'Foundation',
90
- autogenerate: { directory: 'reference/foundation' },
91
- },
92
- {
93
- label: 'UIKit',
94
- autogenerate: { directory: 'reference/uikit' },
95
- },
96
- {
97
- label: 'QuartzCore',
98
- autogenerate: { directory: 'reference/quartzcore' },
99
- },
100
- {
101
- label: 'Utility',
102
- autogenerate: { directory: 'reference/utility' },
103
- },
104
- {
105
- label: '运行时边界',
106
- items: [
107
- { label: 'JavaScript 原生环境', slug: 'reference/js-runtime' },
108
- { label: 'Value Sturct', slug: 'reference/value-sturct' },
109
- { label: '隐藏的边界(The Black Box)', slug: 'reference/black-box' },
110
- ],
111
- },
112
- {
113
- label: '附录',
114
- items: [
115
- { label: '内建command清单', slug: 'reference/global/builtin-commands' },
116
- ],
117
- },
118
- ],
119
- },
120
- {
121
- label: '关于',
122
- items: [
123
- { label: '贡献指南', slug: 'guides/contributing' },
124
- ],
125
- },
126
- ],
127
-
128
- }),
129
- ],
130
- });