README file from
GithubNote to Public for Obsidian
A plugin to publish Obsidian notes to multiple platforms with one click. Currently supports WeChat Official Account (微信公众号).
Features
- ✅ WeChat Official Account Publishing: Publish drafts or articles directly via official API
- 📝 Obsidian Syntax Support: Supports WikiLink, highlight
==text==, strikethrough~~text~~, Callout, etc. - 📊 Mermaid Diagrams: Automatically render Mermaid diagrams as images and upload them
- 🖼️ Auto Image Upload: Local images are automatically uploaded to WeChat media library
- 🎨 WeChat Formatting: Generate WeChat-compatible HTML for articles
- 👁️ Live Preview: Sidebar preview with automatic updates when switching files
Installation
Manual Installation
- Download the latest release: Releases
- Extract to your Obsidian plugins folder:
<vault>/.obsidian/plugins/obsidian-note-to-public/ - Restart Obsidian
- Enable the plugin in settings
Development Installation
git clone https://github.com/greedyhao/obsidian-note-to-public.git
cd obsidian-note-to-public
pnpm install
pnpm run build
Then copy the project folder to your Obsidian plugins directory.
Configuration
- Open Obsidian Settings -> Community plugins -> Note to Public
- Enter your WeChat Official Account AppID and AppSecret
- Get them from: WeChat Public Platform -> Settings & Development -> Basic Configuration
- AppSecret is encrypted and stored in Obsidian SecretStorage, manageable in Settings -> Security -> Key Storage
- Optional: Set default author name
Usage
Preview Before Publishing
Method 1: Command Palette
- Press
Ctrl/Cmd + Pto open command palette - Type "打开发布预览" (Open Publish Preview) and execute
Method 2: Context Menu
- Right-click on a Markdown file in the file list
- Select "👁️ 打开发布预览" (Open Publish Preview)
Preview Features:
- Preview panel appears in the right sidebar
- Content updates automatically when switching files
- Displays article title, author, summary, etc.
- Shows count of Mermaid diagrams and local images
- Simulates WeChat article rendering
Publish to WeChat Official Account
Method 1: Command Palette
- Open the note you want to publish
- Press
Ctrl/Cmd + Pto open command palette - Type "发布到微信公众号" (Publish to WeChat) and execute
Method 2: File Context Menu
- Right-click on a Markdown file in the file list
- Select "📤 发布到微信公众号" (Publish to WeChat)
Method 3: Editor Context Menu
- Right-click in the editor
- Select "📤 发布到微信公众号" (Publish to WeChat)
Frontmatter Support
Add YAML frontmatter at the top of your note:
---
title: Article Title
description: Article summary (max 54 characters)
author: Author Name
date: 2024-01-01
tags: [tag1, tag2]
---
Supported Obsidian Syntax
| Syntax | Conversion |
|---|---|
[[WikiLink]] |
Plain text (displays alias) |
![[Embed]] |
To be implemented (marked as embed) |
==highlight== |
Yellow background highlight |
~~strikethrough~~ |
Strikethrough text |
> [!note] ... |
Blockquote with icon prefix |
%%comment%% |
Removed |
mermaid ... |
Rendered as image |
Important Notes
WeChat Official Account Limitations
- Requires a verified WeChat Official Account (subscription or service account)
- Daily API call limits apply
- Images cannot exceed 2MB
- Article content must comply with WeChat Public Platform guidelines
Mermaid Diagrams
- Mermaid diagrams are rendered as PNG images and uploaded
- Complex diagrams may take longer to process
- Ensure stable internet connection for image uploads
- Note: HTML labels are disabled to ensure complete diagram rendering using pure SVG
Development
Project Structure
src/
├── main.ts # Plugin entry point
├── settings.ts # Configuration management
├── ui/
│ ├── publish-modal.ts # Publish interface
│ └── preview-view.ts # Preview sidebar view
├── markdown/
│ ├── obsidian-parser.ts # Obsidian syntax parsing
│ ├── mermaid-renderer.ts # Mermaid rendering
│ └── wechat-formatter.ts # WeChat HTML formatting
└── platforms/
└── wechat/
├── auth.ts # WeChat authentication
├── api.ts # WeChat API
└── publisher.ts # Publishing workflow
Build
pnpm run dev # Development mode (hot reload)
pnpm run build # Production build
pnpm test # Run tests
Release
To create a new release, push a git tag:
# Update version in manifest.json and package.json
# Build the plugin
pnpm run build
# Create and push a tag
git tag -a 0.1.3 -m "0.1.3"
git push origin 0.1.3
GitHub Actions will automatically build and create a draft release with main.js and manifest.json.
Roadmap
- Support more platforms (Zhihu, Juejin, CSDN, etc.)
- Article templates
- Scheduled publishing
- Article history
- Batch publishing
Contributing
Issues and Pull Requests are welcome!
License
MIT License
Acknowledgments
- obsidian-mp-publisher — Referenced DOM processing, image upload, and media library management
- note-to-mp — Referenced Mermaid SVG→PNG conversion, cover upload, and code block handling
- WeMD — Referenced markdown-it + juice rendering, CSS inline strategy, and code block styling