Copy to WeChat

by jerryshi
5
4
3
2
1
Score: 35/100

Description

Copy notes to WeChat as chat-friendly plain text, or as a rendered image. - This plugin has not been manually reviewed by Obsidian staff.

Reviews

No reviews yet.

Stats

stars
27
downloads
0
forks
4
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Copy to WeChat

An Obsidian plugin that copies your notes to WeChat — either as chat-friendly plain text or as a rendered image — straight to the clipboard.

WeChat's chat box does not render rich text, and pasting Markdown there looks messy. This plugin gives you two purpose-built copy actions instead.

Features

  • Copy to WeChat (text) — converts the current selection (or the whole note) into clean plain text tuned for WeChat chat:
    • Headings → 【Title】 (H1/H2) and 「Title」 (H3+)
    • Unordered lists → / / by depth, indented with full-width spaces (WeChat keeps these; it collapses leading half-width spaces)
    • Ordered lists keep their numbers; task lists become /
    • Quotes → , horizontal rules → ————————
    • Tables collapse the |---| separator and join cells with |
    • Bold / italic / strikethrough / inline code are stripped to plain text; links become text(url) (bare URLs and autolinks are kept as-is so WeChat makes them tappable); images become [图片:alt]
  • Copy as image — renders the note with a clean article theme and rasterizes it to a PNG on the clipboard, preserving line breaks and indentation.
  • AI formatting (Copy to WeChat, AI) — sends the note to an OpenAI-compatible LLM that reformats it into WeChat-friendly plain text (reorganizing loose prose into clear points while keeping any existing numbering and hierarchy), then normalizes indentation to full-width spaces so nested items survive a WeChat paste. Falls back to the rule-based text conversion above when no API key is set or the request fails. Requires configuration (see Configuration).

Usage

Right-click in the editor and choose:

  • 复制到微信 / Copy to WeChat — plain text
  • 以图片复制 / Copy as image — PNG image
  • AI 排版复制到微信 / Copy to WeChat (AI) — LLM-formatted plain text (requires configuration)

All three are also available from the Command Palette (Cmd/Ctrl+P), so you can bind hotkeys.

If text is selected, only the selection is converted; otherwise the whole note is used.

Desktop only. Copying images to the clipboard relies on desktop APIs.

Configuration (AI formatting)

The AI 排版 action calls any OpenAI-compatible chat/completions endpoint. Open Settings → Copy to WeChat and fill in:

  • Base URL — e.g. https://api.deepseek.com/v1 or https://openrouter.ai/api/v1
  • API key — stored locally in the plugin's data.json; it is only ever sent to the endpoint you configure
  • Model — e.g. deepseek-chat
  • System prompt — controls the formatting style; leave empty to use the built-in default
  • Test connection — sends a minimal request with your configured model and reports auth (401/403), base-URL (404), model-name (400/422), rate-limit (429) and network/timeout errors distinctly

If no API key is configured, or the request fails or times out, the AI action automatically falls back to the rule-based text conversion above, so it never hard-fails.

Installation

From Community Plugins (once published)

Settings → Community plugins → Browse → search "Copy to WeChat" → Install → Enable.

Manual

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Copy them into <vault>/.obsidian/plugins/copy-to-wechat/.
  3. Reload Obsidian and enable the plugin under Community plugins.

Build from source

npm install
npm run build   # produces main.js
npm test        # run the unit tests

For development, npm run dev rebuilds on change.

License

MIT © jerryshi