finch-markdown-editor 0.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.
- package/README.md +43 -0
- package/dist/codemirror.js +46 -0
- package/dist/index.js +750 -0
- package/dist/panel.html +2353 -0
- package/i18n/zh-CN.json +16 -0
- package/icon.png +0 -0
- package/package.json +207 -0
package/i18n/zh-CN.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Markdown 编辑",
|
|
3
|
+
"description": "在 Finch 中编辑 Markdown,并可预览为微信公众号文章样式;支持框选文字请求 AI 修改和自定义排版。",
|
|
4
|
+
"systemPrompt": "当用户要编辑或预览本地 Markdown 文件时,调用 markdown_editor_document,action 使用 open,并提供绝对路径。当用户要新建/起草一篇全新的 Markdown 文档时,自己先写好完整 Markdown 正文,再调用 action=create 并提供一个尚不存在的绝对路径和 markdown 内容——会一次性写入文件并在 Markdown 编辑器中打开(编辑器界面本身故意不提供“新建”按钮)。当用户要修改编辑器或预览中框选的文字时,给出精确的替换 Markdown,确认后调用 action=apply 并提供完整更新后的 Markdown。当用户要求自定义/AI 设计公众号排版风格时,编写限定在 #bm-md 下的普通 CSS(标签/id 选择器,不用 class,必要时用 !important 覆盖基础风格),可参考 bm.md 内置风格(kami、bauhaus、blueprint、botanical、newsprint、retro、sketch、terminal),然后调用 action=set_style 并提供 css 与简短 label,会立即应用到当前打开的预览。",
|
|
5
|
+
"appPanel": {
|
|
6
|
+
"title": "Markdown 编辑",
|
|
7
|
+
"toolbar": {
|
|
8
|
+
"open": { "tooltip": "打开 Markdown 文件" },
|
|
9
|
+
"annotate": { "label": "批注", "tooltip": "开启批注" },
|
|
10
|
+
"mode": { "label": "预览", "tooltip": "切换到预览" },
|
|
11
|
+
"style": { "tooltip": "排版风格" },
|
|
12
|
+
"save": { "label": "保存", "tooltip": "保存(⌘/Ctrl+S)" },
|
|
13
|
+
"more": { "tooltip": "更多操作" }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/icon.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "finch-markdown-editor",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A Markdown editor and WeChat Official Account style preview, with selection-based AI edits and AI-generated custom styles.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "PuterJam",
|
|
7
|
+
"url": "https://github.com/puterjam"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/puterjam/finch-tools.git",
|
|
12
|
+
"directory": "finch-markdown-editor"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/puterjam/finch-tools/tree/main/finch-markdown-editor#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/puterjam/finch-tools/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"finch",
|
|
23
|
+
"finch-minitool",
|
|
24
|
+
"markdown",
|
|
25
|
+
"wechat",
|
|
26
|
+
"preview",
|
|
27
|
+
"annotation"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js && esbuild src/codemirror.ts --bundle --platform=browser --format=iife --target=chrome120 --minify --outfile=dist/codemirror.js && cp src/panel.html dist/panel.html",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"prepublishOnly": "npm run typecheck && npm run build && npx @finchtoys/minitools doctor ."
|
|
33
|
+
},
|
|
34
|
+
"finch": {
|
|
35
|
+
"manifestVersion": 1,
|
|
36
|
+
"minVersion": "1.6.0",
|
|
37
|
+
"name": "MD Editor",
|
|
38
|
+
"description": "Edit Markdown and preview it as a WeChat Official Account article. Select text for AI edits, or ask AI to design a custom style.",
|
|
39
|
+
"systemPrompt": "When the user wants to edit or preview a local Markdown file, call markdown_editor_document with action 'open' and its absolute path. When the user asks to create/draft a brand-new Markdown document, write the full Markdown yourself and call action 'create' with an absolute path that does not exist yet plus the markdown content — this writes the file and opens it in Markdown Editor in one step (Markdown Editor's own UI intentionally has no 'new file' button). When the user asks to revise a passage selected in Markdown Editor, propose precise replacement Markdown and, once approved, call action 'apply' with the full updated Markdown. When the user asks for a custom/AI-designed WeChat layout style, write plain CSS scoped under #bm-md (tag/id selectors only, use !important where needed to override the base style) inspired by bm.md's built-in styles (kami, bauhaus, blueprint, botanical, newsprint, retro, sketch, terminal), then call action 'set_style' with that css and a short label — it applies immediately in the open preview.",
|
|
40
|
+
"main": "dist/index.js",
|
|
41
|
+
"activationEvents": [
|
|
42
|
+
"onStartup"
|
|
43
|
+
],
|
|
44
|
+
"miniToolType": "local",
|
|
45
|
+
"categories": [
|
|
46
|
+
"productivity"
|
|
47
|
+
],
|
|
48
|
+
"contributes": {
|
|
49
|
+
"tools": true,
|
|
50
|
+
"iconPacks": [
|
|
51
|
+
{
|
|
52
|
+
"id": "markdown-editor-icons",
|
|
53
|
+
"label": "Markdown Editor Icons"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"appPanel": {
|
|
57
|
+
"icon": "newspaper",
|
|
58
|
+
"viewType": "markdown-editor.document",
|
|
59
|
+
"instanceMode": "single",
|
|
60
|
+
"showInLauncher": true,
|
|
61
|
+
"source": {
|
|
62
|
+
"type": "local",
|
|
63
|
+
"path": "dist/panel.html"
|
|
64
|
+
},
|
|
65
|
+
"toolbar": [
|
|
66
|
+
{
|
|
67
|
+
"id": "home",
|
|
68
|
+
"icon": "house",
|
|
69
|
+
"tooltip": "Back to home"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "open",
|
|
73
|
+
"icon": "ext:markdown-editor-icons/folder-open",
|
|
74
|
+
"tooltip": "Open Markdown file"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "save",
|
|
78
|
+
"icon": "ext:markdown-editor-icons/save",
|
|
79
|
+
"label": "Save",
|
|
80
|
+
"tooltip": "Save (Cmd/Ctrl+S)"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "separator"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "annotate",
|
|
87
|
+
"icon": "ext:markdown-editor-icons/file-pen-line",
|
|
88
|
+
"label": "Annotate",
|
|
89
|
+
"tooltip": "Enable annotation"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "mode",
|
|
93
|
+
"icon": "toggle-left",
|
|
94
|
+
"label": "Preview",
|
|
95
|
+
"tooltip": "Switch to preview"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "menu",
|
|
99
|
+
"id": "style",
|
|
100
|
+
"icon": "palette",
|
|
101
|
+
"tooltip": "Layout style",
|
|
102
|
+
"items": [
|
|
103
|
+
{
|
|
104
|
+
"id": "style:kami",
|
|
105
|
+
"label": "Kami"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "style:bauhaus",
|
|
109
|
+
"label": "Bauhaus"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "style:blueprint",
|
|
113
|
+
"label": "Blueprint"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "style:botanical",
|
|
117
|
+
"label": "Botanical"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "style:newsprint",
|
|
121
|
+
"label": "Newsprint"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "style:retro",
|
|
125
|
+
"label": "Retro"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "style:sketch",
|
|
129
|
+
"label": "Sketch"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "style:terminal",
|
|
133
|
+
"label": "Terminal"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "style-sep",
|
|
137
|
+
"label": "",
|
|
138
|
+
"separator": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "style:custom",
|
|
142
|
+
"label": "Custom (AI-designed)",
|
|
143
|
+
"icon": "wand-sparkles"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": "spacer"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "menu",
|
|
152
|
+
"id": "more",
|
|
153
|
+
"icon": "settings",
|
|
154
|
+
"items": [
|
|
155
|
+
{
|
|
156
|
+
"id": "reload",
|
|
157
|
+
"label": "Re-render"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "more-sep",
|
|
161
|
+
"label": "",
|
|
162
|
+
"separator": true
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "about",
|
|
166
|
+
"label": "About rendering"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"permissions": {
|
|
174
|
+
"filesystem": "readwrite",
|
|
175
|
+
"network": false,
|
|
176
|
+
"shell": true
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"devDependencies": {
|
|
180
|
+
"@finchtoys/minitool-api": "^0.3.5",
|
|
181
|
+
"@types/node": "^26.1.0",
|
|
182
|
+
"esbuild": "^0.28.1",
|
|
183
|
+
"typescript": "^6.0.3"
|
|
184
|
+
},
|
|
185
|
+
"files": [
|
|
186
|
+
"dist/",
|
|
187
|
+
"i18n/",
|
|
188
|
+
"icon.png",
|
|
189
|
+
"README.md"
|
|
190
|
+
],
|
|
191
|
+
"dependencies": {
|
|
192
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
193
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
194
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
195
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
196
|
+
"@codemirror/lang-markdown": "^6.5.2",
|
|
197
|
+
"@codemirror/lang-python": "^6.2.1",
|
|
198
|
+
"@codemirror/lang-sql": "^6.10.0",
|
|
199
|
+
"@codemirror/lang-yaml": "^6.1.3",
|
|
200
|
+
"@codemirror/language": "^6.12.4",
|
|
201
|
+
"@codemirror/legacy-modes": "^6.5.3",
|
|
202
|
+
"@codemirror/search": "^6.7.1",
|
|
203
|
+
"@lezer/highlight": "^1.2.3",
|
|
204
|
+
"codemirror": "^6.0.2",
|
|
205
|
+
"codemirror-markdown-tables": "^1.0.1"
|
|
206
|
+
}
|
|
207
|
+
}
|