mn-docs-mcp 0.5.0 → 0.5.2
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
CHANGED
|
@@ -27,7 +27,7 @@ pnpm preview # 预览构建结果
|
|
|
27
27
|
本项目内置一个本地MCPServer,支持stdio与HTTPStream两种方式,返回纯文本片段,适合AI直接调用。
|
|
28
28
|
|
|
29
29
|
embedding模型使用本地BGE-small-zh-v1.5(ONNX),首次启动会自动下载到transformers.js默认缓存目录。模型文件约95.8MB,向量维度为512。
|
|
30
|
-
|
|
30
|
+
模型下载使用镜像https://hf-mirror.com
|
|
31
31
|
|
|
32
32
|
### 快速开始(npx)
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@ static sharedInstance(): Application
|
|
|
26
26
|
| 属性 | 类型 | 说明 |
|
|
27
27
|
| :--- | :--- | :--- |
|
|
28
28
|
| `focusWindow` | `UIWindow` | 当前活动窗口(文档中有时写作 `window`,getter 为 window)。 |
|
|
29
|
-
| `currentTheme` | `string` |
|
|
29
|
+
| `currentTheme` | `string` | 当前主题,包括 `Default` / `Sepia`/ `Gray` / `Dark` / `Green`。 |
|
|
30
30
|
| `dbPath` | `string` | 主数据库文件路径。 |
|
|
31
31
|
| `documentPath` | `string` | 文稿目录路径。 |
|
|
32
32
|
| `cachePath` | `string` | 缓存目录路径。 |
|
|
@@ -1,32 +1,238 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 全局入口对象(Global Variables)
|
|
3
|
-
description: MarginNote
|
|
3
|
+
description: MarginNote插件运行时直接注入到JS环境的全局变量清单与用法入口。
|
|
4
4
|
---
|
|
5
|
+
本页列出MarginNote插件运行时可直接使用的全局变量名。这些全局名对应的对象通常是单例、工厂对象、或系统级入口。
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
> 说明:本页仅做索引。每个对象的完整属性/方法请进入对应参考页。
|
|
8
|
+
|
|
9
|
+
## 全局与入口
|
|
10
|
+
|
|
11
|
+
<table>
|
|
12
|
+
<colgroup>
|
|
13
|
+
<col style="width:28%">
|
|
14
|
+
<col style="width:44%">
|
|
15
|
+
<col style="width:28%">
|
|
16
|
+
</colgroup>
|
|
17
|
+
<thead>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>名称</th>
|
|
20
|
+
<th>用途</th>
|
|
21
|
+
<th>参考</th>
|
|
22
|
+
</tr>
|
|
23
|
+
</thead>
|
|
24
|
+
<tbody>
|
|
25
|
+
<tr>
|
|
26
|
+
<td><code>JSB</code></td>
|
|
27
|
+
<td>Bridge入口</td>
|
|
28
|
+
<td><a href="/reference/global/jsb/">JSB</a></td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<td><code>self</code></td>
|
|
32
|
+
<td>当前实例上下文</td>
|
|
33
|
+
<td><a href="/reference/global/self/">self</a></td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td><code>Application</code></td>
|
|
37
|
+
<td>App入口</td>
|
|
38
|
+
<td><a href="/reference/global/application/">Application</a></td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td><code>Database</code></td>
|
|
42
|
+
<td>数据库访问</td>
|
|
43
|
+
<td><a href="/reference/global/database/">Database</a></td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td><code>Note</code></td>
|
|
47
|
+
<td>创建笔记</td>
|
|
48
|
+
<td><a href="/reference/global/note/">Note</a></td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<td><code>PopupMenu</code></td>
|
|
52
|
+
<td>弹出菜单</td>
|
|
53
|
+
<td><a href="/reference/global/popup-menu/">PopupMenu</a></td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td><code>PopupMenuItem</code></td>
|
|
57
|
+
<td>菜单项</td>
|
|
58
|
+
<td><a href="/reference/global/popup-menu-item/">PopupMenuItem</a></td>
|
|
59
|
+
</tr>
|
|
60
|
+
<tr>
|
|
61
|
+
<td><code>SearchManager</code></td>
|
|
62
|
+
<td>搜索与索引(<code>Application.sharedInstance().searchManager</code>)</td>
|
|
63
|
+
<td><a href="/reference/global/search-manager/">SearchManager</a></td>
|
|
64
|
+
</tr>
|
|
65
|
+
</tbody>
|
|
66
|
+
</table>
|
|
67
|
+
|
|
68
|
+
## MarginNote核心
|
|
69
|
+
|
|
70
|
+
下表覆盖 `/reference/marginnote/`目录下的全部参考页,用于快速定位对象定义与用法入口。
|
|
71
|
+
|
|
72
|
+
<table>
|
|
73
|
+
<colgroup>
|
|
74
|
+
<col style="width:28%">
|
|
75
|
+
<col style="width:44%">
|
|
76
|
+
<col style="width:28%">
|
|
77
|
+
</colgroup>
|
|
78
|
+
<thead>
|
|
79
|
+
<tr>
|
|
80
|
+
<th>名称</th>
|
|
81
|
+
<th>用途</th>
|
|
82
|
+
<th>参考</th>
|
|
83
|
+
</tr>
|
|
84
|
+
</thead>
|
|
85
|
+
<tbody>
|
|
86
|
+
<tr>
|
|
87
|
+
<td><code>StudyController</code></td>
|
|
88
|
+
<td>学习入口(从<code>Application</code>获取)</td>
|
|
89
|
+
<td><a href="/reference/marginnote/study-controller/">StudyController</a></td>
|
|
90
|
+
</tr>
|
|
91
|
+
<tr>
|
|
92
|
+
<td><code>NotebookController</code></td>
|
|
93
|
+
<td>脑图与大纲(从<code>StudyController</code>获取)</td>
|
|
94
|
+
<td><a href="/reference/marginnote/notebook-controller/">NotebookController</a></td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td><code>ReaderController</code></td>
|
|
98
|
+
<td>阅读区控制(从<code>StudyController</code>获取)</td>
|
|
99
|
+
<td><a href="/reference/marginnote/reader-controller/">ReaderController</a></td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td><code>DocumentController</code></td>
|
|
103
|
+
<td>单文档控制(从<code>ReaderController</code>获取)</td>
|
|
104
|
+
<td><a href="/reference/marginnote/document-controller/">DocumentController</a></td>
|
|
105
|
+
</tr>
|
|
106
|
+
<tr>
|
|
107
|
+
<td><code>MindMapView</code></td>
|
|
108
|
+
<td>脑图视图(从<code>NotebookController</code>获取)</td>
|
|
109
|
+
<td><a href="/reference/marginnote/mindmap-view/">MindMapView</a></td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td><code>OutlineView</code></td>
|
|
113
|
+
<td>大纲视图</td>
|
|
114
|
+
<td><a href="/reference/marginnote/outline-view/">OutlineView</a></td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr>
|
|
117
|
+
<td><code>MindMapNode</code></td>
|
|
118
|
+
<td>脑图节点(来自<code>MindMapView</code>/选中列表)</td>
|
|
119
|
+
<td><a href="/reference/marginnote/mindmap-node/">MindMapNode</a></td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td><code>MbBookNote</code></td>
|
|
123
|
+
<td>笔记对象</td>
|
|
124
|
+
<td><a href="/reference/marginnote/mb-book-note/">MbBookNote</a></td>
|
|
125
|
+
</tr>
|
|
126
|
+
<tr>
|
|
127
|
+
<td><code>MbTopic</code></td>
|
|
128
|
+
<td>笔记本对象</td>
|
|
129
|
+
<td><a href="/reference/marginnote/mb-topic/">MbTopic</a></td>
|
|
130
|
+
</tr>
|
|
131
|
+
<tr>
|
|
132
|
+
<td><code>MbBook</code></td>
|
|
133
|
+
<td>文档对象</td>
|
|
134
|
+
<td><a href="/reference/marginnote/mb-book/">MbBook</a></td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td><code>NoteComment</code></td>
|
|
138
|
+
<td>评论结构</td>
|
|
139
|
+
<td><a href="/reference/marginnote/note-comment/">NoteComment</a></td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td><code>JSExtension</code></td>
|
|
143
|
+
<td>插件主类</td>
|
|
144
|
+
<td><a href="/reference/marginnote/jsextension/">JSExtension</a></td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr>
|
|
147
|
+
<td><code>MbModelTool</code></td>
|
|
148
|
+
<td>数据库协议</td>
|
|
149
|
+
<td><a href="/reference/marginnote/mb-model-tool/">MbModelTool</a></td>
|
|
150
|
+
</tr>
|
|
151
|
+
</tbody>
|
|
152
|
+
</table>
|
|
153
|
+
|
|
154
|
+
## Utility
|
|
155
|
+
|
|
156
|
+
<table>
|
|
157
|
+
<colgroup>
|
|
158
|
+
<col style="width:28%">
|
|
159
|
+
<col style="width:44%">
|
|
160
|
+
<col style="width:28%">
|
|
161
|
+
</colgroup>
|
|
162
|
+
<thead>
|
|
163
|
+
<tr>
|
|
164
|
+
<th>名称</th>
|
|
165
|
+
<th>用途</th>
|
|
166
|
+
<th>参考</th>
|
|
167
|
+
</tr>
|
|
168
|
+
</thead>
|
|
169
|
+
<tbody>
|
|
170
|
+
<tr>
|
|
171
|
+
<td><code>UndoManager</code></td>
|
|
172
|
+
<td>撤销与刷新</td>
|
|
173
|
+
<td><a href="/reference/utility/undo-manager/">UndoManager</a></td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td><code>SpeechManager</code></td>
|
|
177
|
+
<td>语音朗读</td>
|
|
178
|
+
<td><a href="/reference/utility/speech-manager/">SpeechManager</a></td>
|
|
179
|
+
</tr>
|
|
180
|
+
<tr>
|
|
181
|
+
<td><code>ZipArchive</code></td>
|
|
182
|
+
<td>ZIP压缩解压</td>
|
|
183
|
+
<td><a href="/reference/utility/zip-archive/">ZipArchive</a></td>
|
|
184
|
+
</tr>
|
|
185
|
+
<tr>
|
|
186
|
+
<td><code>MenuController</code></td>
|
|
187
|
+
<td>菜单视图</td>
|
|
188
|
+
<td><a href="/reference/utility/menu-controller/">MenuController</a></td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<td><code>SQLiteDatabase</code></td>
|
|
192
|
+
<td>执行SQL</td>
|
|
193
|
+
<td><a href="/reference/utility/sqlite-database/">SQLiteDatabase</a></td>
|
|
194
|
+
</tr>
|
|
195
|
+
<tr>
|
|
196
|
+
<td><code>SQLiteResultSet</code></td>
|
|
197
|
+
<td>读取结果</td>
|
|
198
|
+
<td><a href="/reference/utility/sqlite-result-set/">SQLiteResultSet</a></td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr>
|
|
201
|
+
<td><code>SQLiteStatement</code></td>
|
|
202
|
+
<td>缓存语句</td>
|
|
203
|
+
<td><a href="/reference/utility/sqlite-statement/">SQLiteStatement</a></td>
|
|
204
|
+
</tr>
|
|
205
|
+
</tbody>
|
|
206
|
+
</table>
|
|
207
|
+
|
|
208
|
+
## 其它对象
|
|
209
|
+
|
|
210
|
+
本页不再列出Foundation/UIKit/QuartzCore与JavaScript原生环境的全量对象清单;它们的参考条目请在侧边栏对应分组中查阅。下面仅给出常见入口与例子。
|
|
211
|
+
|
|
212
|
+
### Foundation
|
|
213
|
+
|
|
214
|
+
多数Foundation类可直接使用(通常以类/单例形式导出)。例:
|
|
215
|
+
|
|
216
|
+
- [NSFileManager](/reference/foundation/ns-file-manager/)
|
|
217
|
+
- [NSData](/reference/foundation/ns-data/)
|
|
218
|
+
- [NSTimer](/reference/foundation/ns-timer/)
|
|
219
|
+
|
|
220
|
+
### UIKit
|
|
221
|
+
|
|
222
|
+
可用UIKit搭原生UI(视图/控制器/控件等)。例:
|
|
223
|
+
|
|
224
|
+
- [UIApplication](/reference/uikit/uiapplication/)
|
|
225
|
+
- [UIViewController](/reference/uikit/uiview-controller/)
|
|
226
|
+
- [UIButton](/reference/uikit/uibutton/)
|
|
227
|
+
|
|
228
|
+
### QuartzCore
|
|
229
|
+
|
|
230
|
+
图层/动画相关能力主要来自QuartzCore。例:
|
|
231
|
+
|
|
232
|
+
- [CALayer](/reference/quartzcore/calayer/)
|
|
233
|
+
- [CAShapeLayer](/reference/quartzcore/cashape-layer/)
|
|
234
|
+
- [CATransaction](/reference/quartzcore/catransaction/)
|
|
235
|
+
|
|
236
|
+
### JavaScript原生环境
|
|
237
|
+
|
|
238
|
+
插件运行在JavaScriptCore中,标准JavaScript内置对象可用但非浏览器环境;详见:[JavaScript原生环境](/reference/js-runtime/)
|