跳到正文

宝玉:微信公众号内容准备与发布

将 Markdown、HTML 或图文资料整理为微信公众号内容,按原文使用 API 或浏览器完成明确授权的发布操作。

开源精选内容生产33 个文件26,681 Stars浏览次数 0JimLiu/baoyu-skills MIT版本 1567581
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
确认后的文章与图片 账号权限及发布授权 阅读本节完整说明
交付内容
公众号内容与排版 实际执行的发布记录 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

references/article-posting.md

Post markdown articles to WeChat Official Account with full formatting support.

Usage

# Post markdown article
${BUN_X} ./scripts/wechat-article.ts --markdown article.md

# With theme
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --theme grace

# Disable bottom citations for ordinary external links
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --no-cite

# With explicit options
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --author "作者名" --summary "摘要"

Parameters

Parameter Description
--markdown <path> Markdown file to convert and post
--theme <name> Theme: default, grace, simple, modern
--no-cite Keep ordinary external links inline instead of converting them to bottom citations
--title <text> Override title (auto-extracted from markdown)
--author <name> Author name
--summary <text> Article summary
--html <path> Pre-rendered HTML file (alternative to markdown)
--profile <dir> Chrome profile directory

Markdown Format

---
title: Article Title
author: Author Name
---

# Title (becomes article title)

Regular paragraph with **bold** and *italic*.

## Section Header

![Image description](./image.png)

- List item 1
- List item 2

> Blockquote text

[Link text](https://example.com)

Markdown mode converts ordinary external links into bottom citations by default for WeChat-friendly output. Use --no-cite to disable that behavior.

Image Handling

  1. Parse: Images in markdown are replaced with WECHATIMGPH_N
  2. Render: HTML is generated with placeholders in text
  3. Paste: HTML content is pasted into WeChat editor
  4. Replace: For each placeholder:
    • Find and select the placeholder text
    • Scroll into view
    • Press Backspace to delete the placeholder
    • Paste the image from clipboard

Scripts

Script Purpose
wechat-article.ts Main article publishing script
md-to-wechat.ts Markdown to HTML with placeholders
md/render.ts Markdown rendering with themes

Example Session

User: /post-to-wechat --markdown ./article.md

Claude:
1. Parses markdown, finds 5 images
2. Generates HTML with placeholders
3. Opens Chrome, navigates to WeChat editor
4. Pastes HTML content
5. For each image:
   - Selects WECHATIMGPH_1
   - Scrolls into view
   - Presses Backspace to delete
   - Pastes image
6. Reports: "Article composed with 5 images."

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan