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 ADDED
@@ -0,0 +1,43 @@
1
+ # Markdown Editor
2
+
3
+ A focused Markdown editor for Finch with WeChat Official Account preview, selection-based AI edits, and AI-designed custom styles.
4
+
5
+ ## Use it
6
+
7
+ 1. Open **Markdown Editor** from Finch's right Panel and click the **folder** icon to open a `.md` file.
8
+ 2. Edit Markdown directly. Use the **save** button or `Cmd/Ctrl+S` to write changes to disk; external file changes refresh automatically.
9
+ 3. Click the **toggle** button to switch to the WeChat preview. Choose one of bm.md's 8 built-in styles from the **palette** menu.
10
+ 4. Select text in the editor or preview, describe the desired revision in the popup, and add it to the Finch Composer as precise AI context.
11
+ 5. Click the **wand** icon to ask Finch AI to design custom CSS based on the bm.md output structure.
12
+ 6. Use **Copy HTML** to copy inline-styled rich text for the WeChat editor.
13
+
14
+ ## Architecture
15
+
16
+ The Markdown editor is implemented by this mini tool with CodeMirror 6, not by bm.md. CodeMirror owns Markdown parsing, syntax highlighting, line wrapping, selections, active-line rendering, undo history, and keyboard editing. The Panel integration owns file I/O, selection annotations, save state, toolbar interactions, and preview presentation.
17
+
18
+ bm.md is only the rendering engine. The mini tool installs the `bmmd` CLI once into its private storage, then sends the current Markdown to `bmmd render --platform wechat`. The returned inline-styled HTML is displayed in a sandboxed iframe. Article content stays local and no long-running bm.md web service is used.
19
+
20
+ The mini tool is MIT licensed. bm.md / `bmmd` is AGPL-3.0 and is installed separately at runtime rather than bundled into this package.
21
+
22
+ ---
23
+
24
+ # Markdown 编辑器
25
+
26
+ 一个专注于 Markdown 编辑体验的 Finch 小程序,同时提供微信公众号样式预览、框选文字请求 AI 修改,以及 AI 自定义排版。
27
+
28
+ ## 使用方式
29
+
30
+ 1. 从 Finch 右侧 Panel 打开 **Markdown 编辑器**,点击工具栏「文件夹」图标选择 `.md` 文件。
31
+ 2. 直接编辑 Markdown;使用工具栏**保存**按钮或 `Cmd/Ctrl+S` 写入磁盘。文件被外部修改时,编辑器会自动刷新。
32
+ 3. 点击「切换」按钮进入公众号预览,可在「调色板」菜单选择 bm.md 内置的 8 种排版风格。
33
+ 4. 在编辑器或预览中框选文字,在浮层里描述修改要求,即可把精确上下文加入 Finch Composer。
34
+ 5. 点击「魔杖」图标,让 Finch AI 基于 bm.md 的输出结构设计自定义 CSS。
35
+ 6. 使用**复制 HTML**复制带内联样式的富文本,再粘贴到微信公众号编辑器。
36
+
37
+ ## 架构关系
38
+
39
+ Markdown 编辑器不是 bm.md 内置编辑器,而是小程序内集成的 CodeMirror 6。Markdown 解析、语法高亮、自动换行、选区、当前行、撤销历史和键盘编辑由 CodeMirror 负责;文件读写、选区批注、保存状态、工具栏交互和预览容器由 Finch 小程序负责。
40
+
41
+ bm.md 只负责渲染。小程序会把 `bmmd` CLI 一次性安装到自己的私有存储目录,然后将当前 Markdown 交给 `bmmd render --platform wechat`;返回的内联样式 HTML 再显示到沙箱 iframe 中。文章内容全程留在本机,也不需要常驻 bm.md Web 服务。
42
+
43
+ 小程序本身采用 MIT 许可证;bm.md / `bmmd` 为 AGPL-3.0,因此运行时独立安装,不直接打包进小程序。