WeChat Styler 将 Markdown 转换为可直接粘贴到微信公众号编辑器的 HTML,支持内联样式、八种精心设计的主题以及确定性兼容性验证。

Stars

23

7 天增长

暂无数据

Fork 数

1

开放 Issue

0

开源协议

MIT

最近更新

2026-07-17

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过脚本(而非猜测)强制执行微信兼容性规则,提供基于 YAML 的主题定制而无需修改代码,并包含可选的组件层(不使用表格),解决了 Markdown 转微信文章时格式丢失的痛点。

适合谁使用

  • 使用 Markdown 写作的公众号编辑
  • 需要将技术文章发布到微信的技术写作者
  • 构建自动化微信内容管道的开发者
  • 需要统一品牌风格的微信排版团队

典型使用场景

  • 将一篇写好的 Markdown 文章转换为微信 HTML,并应用如 magazine-ink 等主题
  • 批量转换多个 Markdown 文件为微信兼容的 HTML
  • 验证现有 HTML 文件是否符合微信编辑器的限制
  • 通过复制和修改 YAML 主题文件创建自定义品牌主题

项目优势

  • 所有样式均为内联,背景使用纯色十六进制值,粘贴后无格式丢失
  • 八个具有真正排版个性的主题,而不仅仅是颜色替换
  • 确定性验证脚本(validate.mjs)会扫描所有微信会删除的内容并输出带行号的报告
  • 主题以 YAML 文件定义,添加或定制无需改动代码

使用前须知

  • 依赖 Node.js 18+ 以及 marked、js-yaml、glob 等库
  • 此仓库为生成的镜像,问题和贡献请前往上游主仓库
  • 内置品牌主题仅为示例,并非推荐,用户需要自行创建自己的品牌主题

README 快速开始

[!IMPORTANT] This repository is a generated compatibility mirror. The editable source, Issues, and contributions live in zjp1997720/zhijian-skills.

WeChat Styler

Turn Markdown into paste-ready WeChat HTML with crafted themes, deterministic validation, and zero external CSS.

简体中文 · Canonical source · Standalone mirror

Use it when an article is finished in Markdown and needs a stable, branded, paste-ready WeChat layout.

Agent Install

npx skills add zjp1997720/wechat-styler -g -a codex --skill wechat-styler -y

Works with any agent runtime that loads SKILL.md (Codex, Claude Code, OpenCode, etc.).

Requirements

  • Node.js 18+
  • marked, js-yaml, glob (auto-installed by the skill runtime or npm install)

What It Does

  • Markdown → WeChat HTML in one step. All styles inlined, all backgrounds solid hex, paste straight into the editor — no format loss.
  • 8 themes with real typographic personality. Not color swaps. magazine-ink is a classic editorial layout; magazine-indigo is a research column with uppercase headings; magazine-forest is a field note with centered kaishu titles. Each theme has its own heading structure, quote style, list marker, and code block.
  • Optional component layer (--components). 6 structured components (keyquote, callout, warning, steps, flow cards, compare cards) for visualizing comparisons, flows, and key points. Off by default — pure markdown rendering for 90% of cases; opt in when you need structured presentation. All components use section + flex, no tables (WeChat editor adds grey borders to tables).
  • Deterministic compatibility gate. validate.mjs scans the output for everything WeChat strips (``, class, rgba(), position:fixed, @media…) and prints a line-numbered report. The rules are enforced by script, not by the model remembering them.
  • Placeholder mechanism. Write 【插入:screenshot】 on its own line while images aren't ready; it renders as a dashed placeholder box. Replace it with a normal Markdown image link when the asset lands.

How It Works

Three pieces, each with one job:

  1. scripts/convert.mjs — parses Markdown via marked, applies a theme-specific renderer (6 renderer presets backing 8 themes), emits fully inlined HTML.
  2. scripts/components.mjs

项目描述

Turn Markdown into paste-ready, inline-styled HTML for WeChat Official Account. 10 themes, deterministic validation, placeholder support.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

7-e1even
精选
7-e1even GitHub avatar

learn-agent

A collection of notes on building coding agents, derived from the production development of the desktop agent Reina, with each mechanism simplified into a zero-dependency, single-file Node.js demo.

AI 与机器学习大语言模型
218
makecindy
精选
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI 与机器学习大语言模型
958
S40911120
精选
S40911120 GitHub avatar

recensa

Recensa is a self-hosted web viewer that indexes Claude Code session transcripts into a local SQLite database, enabling full-text search, replay, and audit of all past agent conversations without uploading data anywhere.

AI 与机器学习大语言模型
67