WeChat Multi Publisher

approved

by fengwei4707@gmail.com

Publish Markdown notes to multiple WeChat Official Accounts. - This plugin has not been manually reviewed by Obsidian staff.

1 stars97 downloadsUpdated 18d agoMIT

WeChat Multi Publisher for Obsidian

Publish Markdown notes to the draft boxes of multiple WeChat Official Accounts from Obsidian.

Desktop only: Windows, macOS, and Linux

Features

  • Manage and publish to multiple WeChat Official Accounts in one operation.
  • Preview articles with 13 bundled CSS themes or your own vault-based themes.
  • Upload, compress, and reuse cover images and note images.
  • Remove YAML frontmatter before publishing when desired.
  • Export the formatted article as a long PNG image.
  • Store AppSecret, access tokens, and proxy passwords in Obsidian SecretStorage.
  • Use optional HTTP or SOCKS5 proxies and retain local publishing history.

Installation

Download the latest GitHub release, then place main.js, manifest.json, and styles.css in:

.obsidian/plugins/wechat-multi-publisher/

Enable WeChat Multi Publisher in Obsidian under Settings → Community plugins.

Privacy and network access

The plugin contacts the WeChat Official Account API only when you test an account, check its status, upload media, or create a draft. Proxy tests may contact api.ipify.org. Article content and images are not sent to servers controlled by the plugin author. Credentials are stored with Obsidian SecretStorage and are not written to data.json.

中文说明

一款 Obsidian 插件,支持将 Markdown 笔记批量发布到多个微信公众号草稿箱。

支持 Windows / macOS / Linux 桌面端

功能特性

  • 多账号管理:同时管理多个公众号,一键批量发布
  • CSS 排版主题:内置 13 款精选排版样式,也可自定义 CSS 主题
  • 封面图片:支持上传封面图片,发布时自动压缩
  • 默认封面:可在设置中保存一张默认封面
  • 实时预览:发布前可预览排版效果
  • 长图导出:将排版后的文章保存为 PNG 到当前笔记目录
  • Frontmatter 处理:可选择剥离 YAML frontmatter
  • 图片压缩上传:自动将笔记中的图片压缩并上传到公众号素材库
  • 代理支持:支持 SOCKS5 / HTTP 代理,解决网络访问问题
  • 发布历史:记录每次发布结果,方便回溯

安装

手动安装

  1. 下载最新的 Release
  2. 解压到你的 Obsidian vault 的 .obsidian/plugins/wechat-multi-publisher/ 目录
  3. 在 Obsidian 设置 → 第三方插件中启用「WeChat Multi Publisher」

目录结构

.obsidian/plugins/wechat-multi-publisher/
├── main.js          # 插件主文件
├── styles.css       # 插件样式
├── manifest.json    # 插件元数据
└── data.json        # 运行时配置(自动生成,勿手动编辑)

内置主题已打包进 main.js,安装 Release 中的三个文件即可使用;仓库内的 themes/ 是主题源文件。

配置

1. 添加公众号

  1. 打开 Obsidian 设置 → WeChat Multi Publisher
  2. 点击「添加账号」
  3. 填入公众号的 AppIDAppSecret
    • 微信公众平台 → 设置与开发 → 基本配置中获取
    • 需要将服务器 IP 添加到公众号的 IP 白名单中
  4. (可选)配置代理服务器

2. 配置 CSS 主题

插件自带 13 款排版主题,开箱即用。你也可以添加自定义主题:

  1. 在 vault 中创建一个文件夹(如 css-themes/
  2. 在其中放入 .css 文件或包含 CSS 代码块的 .md 文件
  3. 在插件设置中配置「CSS 文件夹路径」指向该文件夹

CSS 文件格式:

直接使用 .css 文件,或者在 .md 文件中用代码块包裹:

# 我的自定义主题

```css
h1 {
    color: #333;
    border-bottom: 2px solid #07C160;
}

p {
    line-height: 1.8;
    color: #555;
}
```

使用方法

  1. 打开侧边栏的「WeChat Multi Publisher」面板
  2. 打开你要发布的 Markdown 笔记
  3. 选择排版样式(可选)
  4. 上传封面图片(可选)
  5. 勾选要发布到的公众号
  6. 点击「预览」查看效果,或直接点击「发布」

文章会发布到公众号的草稿箱中,你可以在微信公众平台中进一步编辑和发布。

内置主题预览

主题名称风格描述
Apple极简-黑苹果风格极简排版,黑色主调
清水极简-黑清爽简约风格
Nikkei-红日经新闻风格,红色点缀
流光底线-金蓝金蓝渐变底线装饰
层级书签-蓝书签式层级标题,蓝色系
浮雕卡片-靛蓝卡片式浮雕效果
霓虹暗底-青紫暗色背景霓虹风格
书刊居中-酒红书刊式居中排版
渐隐底线-粉紫渐隐底线装饰,粉紫色系
胶囊药丸-绿胶囊标签风格
报刊夹线-红报纸夹线风格
荧光马克-绿荧光笔标记效果,绿色
荧光马克-蓝荧光笔标记效果,蓝色

注意事项

  • 需要已认证的微信公众号(服务号或已认证的订阅号)
  • AppSecret 请妥善保管,不要泄露
  • AppSecret、Access Token 和代理密码保存在 Obsidian SecretStorage 中,不写入 data.json
  • 发布需要将服务器/代理 IP 添加到公众号的 IP 白名单
  • 图片会自动压缩上传至公众号素材库

隐私与网络请求

插件只在你测试账号、检测状态或发布草稿时请求微信公众平台 API;测试代理或查看出口 IP 时会请求 api.ipify.org。若配置代理,相应请求会经过该代理。文章正文和图片不会上传到作者控制的服务器。

开发

npm install
npm run build

构建会生成 Obsidian 运行所需的 main.js。提交问题前请阅读 CONTRIBUTING.md;安全问题请按 SECURITY.md 的方式报告。

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.