wechat-style-extractor README

The project's README from github.com/sennkuwu/wechat-style-extractor. As one markdown file: README.md.

样格 · WeChat Style Extractor

样格社交预览

从公众号文章中统计颜色、字号、行高、间距和内容组件,预览并复制文章排版。

样式统计是启发式识别;未识别项不显示,预览使用默认值。内联样式不能保证公众号编辑器完整保留原始排版。

当前版本

这是一个可交互的公众号样式提取工具,支持尝试解析公开的公众号文章链接,并提供:

出于安全考虑,解析接口只访问 https://mp.weixin.qq.com,并限制跳转域名、响应大小与读取时间。微信偶尔会对服务器访问展示安全验证页,此时页面会给出明确提示,可稍后重试。

本地运行

需要 Node.js 22.13 或更高版本。

npm install
npm run dev

生产构建:

npm run build

测试:

npm test

网站地址

https://wechat-style-extractor.godkey810.chatgpt.site/

发布与恢复

GitHub 源码仓库和体验站托管仓库是独立的远端。更新 GitHub 不会自动更新体验站;每次发布前需按托管平台的实际发布流程更新原体验站。

发布新版前会在 GitHub 为当时的 main 创建 backup/pre-upgrade-<date> 标签。需要恢复时,以该标签创建恢复提交并按正常发布流程更新,不改写 Git 历史。

隐私与版权

本项目只用于分析排版规则和生成原创模板。请尊重文章、图片、插画、Logo 与品牌素材的版权,不要直接搬运未经授权的内容。

License

MIT

wechat-style-extractor (sennkuwu/wechat-style-extractor)

Searching Database…

What is this?This tool scans a WeChat official account (公众号) article, extracts its visual styling (colors, font sizes, line heights, spacing) and content components, then lets you preview the layout and copy it as rich text you can paste back into the WeChat editor.
Is this a web app I open in a browser, or something I install?It is a self-hosted web app built with Next.js (via 'vinext') - you run it locally or deploy it somewhere, then use it through a browser; there is no separate desktop package.
How do I turn a WeChat article into a template?You paste a public WeChat article link into the input field; the server fetches and sanitizes the HTML, then shows a mobile-style preview with the recognized colors, fonts, spacing and components.
What do I need to run this locally?You need Node.js 22.13 or newer; the project itself relies on cheerio for HTML parsing, juice for inlining styles, and Next.js/React for the UI.
Does it capture an article's styling perfectly?No - style detection is heuristic, so unrecognized properties are simply skipped and shown with default values, and the inlined styles are not guaranteed to survive untouched once pasted into WeChat's own editor.
What visual details does it detect from an article?It recognizes the title, author, colors, font sizes, line heights, spacing and content components used in the original article.
Does the preview keep the original images?Yes, it preserves the in-article images, lazy-loaded images, and CSS background images used inside cards.
Can I just paste the result into WeChat's own editor?Yes, the tool auto-inlines the article's stylesheet (keeping grids, positioning, shadows, lists and tables) and offers a rich-text copy feature meant to be pasted directly into the WeChat official account editor.
Creator
sennkuwu
Size
0.8 MB
Stars
155
Updated
CommitSep 05
Age
1mo
Commits · 90 Days