跳到正文

WeChat Article Formatter for Codex

Convert Obsidian Markdown notes with images into WeChat-ready styled article outputs, saving both HTML and an Obsidian review note back into the vault. Use when the user asks to format, polish, convert, or prepare a Markdown/Obsidian article for a WeChat public account.

个人 Skill内容生产3 个文件浏览次数 0
开始使用

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

环境与依赖
Required:The formatter needs: markdown beautifulsoup4 Pygments cssutils, lxml, and watchdog from the original community skill are not required by this Codex version. 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

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

正文

获取原文件

SKILL.md

Use this skill when the user wants an Obsidian note turned into a polished WeChat public-account article.

Default Workflow

  1. Identify the input note.

    • Prefer an explicit .md path.
    • If the user says "the latest Obsidian article", search the vault for recent Markdown files and confirm the likely source only when ambiguous.
    • Default vault path: /Users/liuhaoxian/Downloads/我的/Obsidian.
  2. If the user provides a reference WeChat article, try to read it first.

    • Extract reusable layout ideas: opening rhythm, heading hierarchy, image placement, emphasis blocks, conclusion style, and copy-to-WeChat caveats.
    • If the page is blocked or cannot be fetched, say so briefly and proceed with the default layout strategy.
  3. Convert the source note with:

python3 scripts/obsidian_wechat_format.py \
  --input "/Users/liuhaoxian/Downloads/我的/Obsidian/path/to/article.md"
  1. Save outputs back into Obsidian.

    • Default output folder: 公众号排版 beside the source note.
    • HTML output: <title>.wechat.html, ready to open in a browser and copy into the WeChat editor.
    • Obsidian output: <title>.wechat.md, a review note containing the styled article body and publishing checklist.
    • Component library output: 公众号组件库.wechat.md, reusable module patterns for future articles.
    • Local images are copied into <title>_assets/ and rewritten to relative paths.
  2. Verify the output.

    • Read the generated .wechat.md and .wechat.html paths.
    • Check whether image files were resolved and copied.
    • If dependencies are missing, install only the packages listed in requirements.txt.

Dependencies

Required:

pip3 install -r requirements.txt

The formatter needs:

  • markdown
  • beautifulsoup4
  • Pygments

cssutils, lxml, and watchdog from the original community skill are not required by this Codex version.

Obsidian Handling

Supported image syntaxes:

![[image.png]]
![[folder/image.png|caption]]
![caption](relative/path/image.png)

Supported note links:

[[Some Note]]
[[Some Note|alias]]

Non-image wiki links are converted to readable text so the WeChat article does not contain broken Obsidian-only syntax.

Layout Strategy

Use a restrained WeChat layout:

  • Remove the H1 from the body; WeChat has its own title field.
  • Treat the first one or two paragraphs as the lead and give them a softer card style.
  • Use clear H2 section blocks and compact H3 subheads.
  • Keep paragraphs airy but not decorative.
  • Convert Obsidian callouts and ::: blocks into inline styled information cards.
  • Keep images full width with captions when available.
  • Add a final checklist in the Obsidian output for title, cover image, local image upload, mobile preview, and link checks.

Avoid adding unrelated rewriting unless the user asks for content editing. Formatting should preserve the original article's substance.

Component Library Strategy

The reference article "新媒体人看过来:用 SOLO 快速设计公众号视觉模板" is useful mainly for its workflow: do not design one-off article pages; split WeChat publishing into reusable components and keep improving that library.

Apply this idea when formatting:

  • Preserve stable inline CSS because the WeChat editor may strip stylesheet-based rules.
  • Prefer mobile-safe single-column layouts for images and cards.
  • Keep component names consistent so the user can reuse them across articles.
  • Generate or update a small component library note in the output folder.

Supported component blocks:

::: qa
Q: 这个方法适合谁?
A: 适合长期做公众号、希望统一视觉风格的人。
:::

::: timeline
- 选题:明确文章主线
- 写作:完成正文
- 排版:生成公众号版本
:::

::: author
刘浩南|医疗 AI、产品与内容系统
:::

::: readmore
- [[上一篇文章]]
- [外部链接](https://example.com)
:::

::: cta
如果这篇对你有帮助,欢迎点赞、在看或转发。
:::

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

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

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

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