Uploadweixin
Version: v1.1 WeChat Rich Copy stable release.
Overview
Convert a Markdown article into WeChat Official Account friendly HTML that can be pasted into the editor. Generate both article.html and a local preview.html, then validate that the article avoids unsafe tags, event attributes, external CSS/JS, and unsupported layout CSS.
This skill is intentionally a small pipeline, not a rich-text editor or publishing bot. Keep rules in references/, execution in scripts/, and the entry workflow concise.
Supported themes: upload-clean, tech-blue, github-dev, editorial, ink, newspaper, sspai-red, mint-card, amber-note, bauhaus, timeline, dialogue.
v1.1 copy rule: article.html is the generated payload, not the primary copy UI. Prefer preview.html rich-copy button or the macOS clipboard script. Avoid cross-device clipboard sync and input-method clipboard sync because they often strip text/html / RTF data and leave only plain text.
Workflow
- Confirm the input Markdown file exists.
- Choose a theme: default to
upload-clean; usegithub-devortech-bluefor technical writing,editorialorinkfor long essays, anddialoguefor Q&A articles. - Render the article:
python3 scripts/render_wechat_article.py \
--input /path/to/article.md \
--theme upload-clean \
--output /tmp/wechat-output \
--footer enabled
- Validate the generated article:
python3 scripts/validate_wechat_html.py \
/tmp/wechat-output/article.html
- Generate the local rich-copy preview page:
python3 scripts/make_preview.py \
--input /tmp/wechat-output/article.html \
--output /tmp/wechat-output/preview.html
- Report the real output paths and validation result.
- Tell the user to open
preview.html, click复制到公众号编辑器, then paste into the WeChat editor. Do not tell the user to copy by selecting the renderedarticle.htmlpage; browsers may place only plain text on the clipboard.
macOS Rich Clipboard
Use the macOS clipboard script when browser copy, input-method clipboard sync, or cross-device clipboard sync loses formatting:
swift scripts/copy_wechat_clipboard_macos.swift \
/tmp/wechat-output/article.html
Then paste into the WeChat editor on the same Mac. Diagnose the current clipboard with:
swift scripts/diagnose_clipboard_macos.swift
PASS rich clipboard is available means the clipboard contains public.html or RTF. If it says plain text only, formatting will likely be lost when pasted into WeChat.
Batch Theme Gallery
Use the batch script when the user wants multi-theme samples from the same Markdown:
python3 scripts/render_theme_gallery.py \
--input /path/to/article.md \
--output /tmp/uploadweixin-gallery \
--footer enabled
The batch script renders all 12 themes. Each theme directory contains article.html, preview.html, and validate.txt; the output root contains gallery.html for visual comparison.
Footer Options
The Upload / 记忆同步 footer is enabled by default.
- Use
--footer disabledwhen the user asks for no brand tail. - Use
--footer-text "..."when the user asks for custom footer copy. - The renderer avoids appending the default footer when the article already contains an obvious Upload / 记忆同步 promotion.
Examples:
python3 scripts/render_wechat_article.py \
--input /path/to/article.md \
--theme editorial \
--output /tmp/wechat-output \
--footer disabled
python3 scripts/render_wechat_article.py \
--input /path/to/article.md \
--theme upload-clean \
--output /tmp/wechat-output \
--footer enabled \
--footer-text "多Agent记忆同步,请使用upload.one,支持GPT Claude。"
Resources
Read only the references needed for the task:
references/wechat-html-rules.md: WeChat-compatible HTML and validation boundaries.references/themes.md: 12 inline-safe theme rules and theme selection guidance.references/brand-footer.md: Upload footer behavior, copy, and dedupe policy.
Use the scripts directly:
scripts/render_wechat_article.py: Markdown to inline-styledarticle.html.scripts/validate_wechat_html.py: PASS/FAIL validator for WeChat-hostile HTML.scripts/make_preview.py: Localpreview.htmlwith rendered article, source HTML, and rich-copy button.scripts/render_theme_gallery.py: Batch render all 12 themes with validation andgallery.html.scripts/copy_wechat_clipboard_macos.swift: Writearticle.htmlto macOS system clipboard as HTML + RTF + plain text.scripts/diagnose_clipboard_macos.swift: Check whether the current macOS clipboard has rich text types.
Output Contract
The renderer writes:
article.html: the paste-ready WeChat article body.preview.html: generated separately bymake_preview.py; open this page and use the复制到公众号编辑器button for rich-text clipboard copy.
The validation report must be based on a fresh command run. Do not claim a generated article is ready for WeChat until validate_wechat_html.py returns PASS.
评论
加载中…