Tallon30 downloadsPreview Markdown with WeChat-friendly formatting and copy rich text with hosted images.
An Obsidian desktop plugin that previews Markdown using a WeChat-friendly theme and copies rich text, including local article images, into the WeChat Official Account editor. Open a Markdown note, preview it from the ribbon, choose Copy to WeChat, and paste into the editor. No WeChat API credentials are required for copying.
Previewing and copying stay local. Local images are embedded into the rich-text clipboard and are not uploaded by the plugin.
一款桌面端 Obsidian 插件,用统一的公众号样式预览 Markdown,并把带格式正文和本地配图一键复制到微信公众号编辑器。
![[image.png]]![[image.png|400]] 与  中设置的图片宽度☐ 与 ☑下载 Release 中的 ZIP,解压到仓库的 .obsidian/plugins/dou-publish-preview/。目录内至少应有:
main.js
manifest.json
styles.css
重启 Obsidian,在“设置 → 第三方插件”中启用 Dou Publish for WeChat。
Obsidian 不能直接运行 src/*.ts,需要先把源码编译成 main.js:
git clone https://github.com/miracle0828/dou-publish-for-wechat.git dou-publish-preview
cd dou-publish-preview
npm install
npm run build
编译完成后有两种安装方式:
.obsidian/plugins/dou-publish-preview/,直接重启 Obsidian 并启用插件。main.js、manifest.json、styles.css 复制到 .obsidian/plugins/dou-publish-preview/,然后重启 Obsidian。运行源码与构建插件需要 Node.js 18 或更高版本;普通使用者安装 Release 不需要 Node.js。
Ctrl+V。标题与封面仍在公众号后台单独填写。如需调整排版,打开“设置 → Dou Publish for WeChat”。设置会同时作用于侧栏预览和复制后的公众号正文,也可以随时恢复默认排版。
外链图片不会被插件自动下载,请先保存到 Obsidian 仓库。GIF 超过 10 MB 时仍可复制,但粘贴可能较慢。
需要 Node.js 18 或更高版本。
npm install
npm test
npm run build
npm run package
排版引擎使用开源包 baoyu-md。零配置图片复制流程参考了 Wechat Converter 的“本地图片转 Data URL 后写入富文本剪贴板”方案,未复制其源码。