WeChat Official Account All-Purpose Formatting
Converts any user-provided document content into uniform, visually appealing HTML that can be directly pasted into the WeChat Official Account editor.
Workflow
Formatting is achieved by combining three orthogonal dimensions: Theme (color palette, themes.md) × Style (visual language, styles.md) × Preset (article structure, presets.md).
- Read Content: Receive the user's text/Markdown/file.
- Select Theme & Style:
- If specified by the user → use directly.
- If not specified → recommend based on content tone (see tables below), and inform the user of the chosen combination in one sentence without waiting for confirmation. Default style is "Soft Card Style".
- Select Article Type Preset (determines component combination tendency, see
references/presets.md). - Read
references/components.mdto get component templates, replace{{tokens}}with the selected palette values fromreferences/themes.md; if the style is not the default, modify the form according to the global override rules inreferences/styles.md; replace foundational components with signature components directly. - Convert paragraph by paragraph according to the "Content Mapping Rules", output the complete HTML.
- Self-check: Verify against "Hard Constraints" to ensure no original text has been omitted.
Theme Recommendations
| Content Tone | Theme |
|---|---|
| Health, Lifestyle, Environmental, Growth Tips | Fresh Green |
| AI, Tech, Internet, Digital Reviews | Tech Blue |
| Business Analysis, Finance, Industry Reports | Business Black & Gold |
| Food, Travel, Event Previews, Promotions | Vibrant Orange |
| Psychology, Literature, Women's Growth, Paid Knowledge | Elegant Purple |
| Festivals, Chinese Trend, Positive Energy, Major Events | Chinese Red |
| Emotions, Beauty, Mom & Baby, Xiaohongshu-style | Pastel Pink |
| Long-form Deep Reads, Character Features, Minimalist Aesthetic | Minimal Black & White |
Style Recommendations
| Content Tone | Style |
|---|---|
| General, Safe, No Mistakes | Soft Card Style (default) |
| Trend Culture, Design Circles, Sharp Opinions | Neo-Brutalism |
| Music, Subculture, Retro Creativity | Vaporwave |
| Long-form Deep Reads, Design Critique, Rational Restraint | Swiss Internationalism |
| Traditional Culture, Solar Terms, Poetry, Tea & Wine | Elegant Chinese Style |
| Programmers, AI Tech, Geek Reviews | Retro Terminal |
| Parent-Child, Activities, Light-hearted Playful | Memphis |
| Character Features, Lifestyle, Brand Soft Ads | Magazine Editorial Style |
| AI Products, SaaS, Tech Release Copy | Glassmorphism Gradient |
| Product Launches, Tool Reviews, Year-in-Review, Big Tech Vibe | Landing Page (Color Band Section Paradigm) |
When a user provides a reference article/screenshot requesting "make it in this style," analyze it using the five-layer dissection process in references/style-lab.md and generate a new style; do not copy pixel values exactly.
Vaporwave, Elegant Chinese Style, Retro Terminal, and Memphis come with their own dedicated color palettes; when one of these is selected, ignore the theme dimension. See the combination suggestion table at the end of styles.md for forbidden combinations.
Content Mapping Rules
| Original Feature | Component to Use |
|---|---|
| First paragraph of the article | Drop Cap paragraph (if a Lead Card is already used, the first paragraph becomes a normal paragraph; the two are mutually exclusive) |
| Opening lead/summary | Lead Card |
| Major section switch | Numbered Separator (01, 02…) or Heading 1 block; choose one for the entire article: use Numbered Separator for sections without heading text, use Heading 1 block for sections with heading text; the two must not be used consecutively |
| Heading 1 | Heading 1 block (automatically append an English subtitle, e.g., WHY IT MATTERS) |
| Heading 2 | Heading 2 (left vertical bar) |
| Heading 3 | Heading 3 (▍ bold line) |
| Core conclusions, key concepts (max 2 per paragraph) | Highlighted annotation (colored background) |
| Terms, data, action words (at least 1 per long paragraph) | Bold keyword (no background) |
| Golden quotes, core viewpoints | Quote Card or centered emphasis |
| Core principles, point summary | Info Card |
| Steps, processes | Step Timeline |
| Parallel points | List Card |
| Two-way comparison | Comparison Double Column |
| Key numbers | Number Highlight |
| Quotes from others/literature | Blockquote |
| Q&A content | FAQ component |
| Tips/warnings | Tip Bar |
| Code | Code Block |
| Image placeholder | Standard Image Component (keep original URL; if no image, output <!-- Place image here: xxx --> comment) |
| Ending summary | Key Points Card |
| End of article | Follow-up Card (if no Official Account name provided, use generic copy "Tap [Watching]") |
Hard Constraints (WeChat Editor Compatibility)
- All styles must be inline styles;
<style>tags, class selectors (except retained WeChat classes likerich_pages wxw-img) are forbidden. - All innermost
<span>elements directly wrapping text must be written as<span leaf="">(abbreviated as<span>in component templates; unifiedly addleaf=""when generating HTML). This bypasses the WeChat editor's style filter to prevent styles from being stripped after pasting. position,transform,float(except drop cap's float, which is a verified working usage),id, JS, and external fonts are forbidden.- Layout must use only
section+p+span; double columns usedisplay: inline-blockortable. - Images must include
class="rich_pages wxw-img"andmax-width:100% !important. - Font size range: 11px–36px; body text 15px, line height 2.0–2.1,
letter-spacing: 0.3px, justified alignment. - Outer container:
<section>wrapping the entire article, background#ffffff, padding32px 20px, font stack-apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif. - Append the standard ending at the end of the code:
<p style="display: none;"><br/></p>
<section class="_135editor"><mp-style-type data-value="3"></mp-style-type></section>
<p><br/></p>
Visual Hierarchy Specifications (Mandatory for Clear Hierarchy)
The primary goal of formatting is to make the structure obvious at a glance. Self-check item by item:
- Font size steps must create clear gaps: Heading 1 22px > Heading 2 17px > Body text 15px > Captions/Sources 13px. Additionally, set an emphasis layer at 18–20px, used only for centered emphasis, Key Points Card, Quote Card (18px), and Number Highlights; these must be centered or placed within cards to avoid confusion with headings. Adjacent levels must differ by ≥ 2px; unify the same level across the whole article; do not add new font sizes (decorative text like badges, capsule labels are excluded from the step system).
- Visual weight steps: Heading 1 = card + bold + large font; Heading 2 = left vertical bar + bold, no card; Heading 3 = ▍ prefix bold line, no line or card; body text has no decoration. Adjacent heading levels must never look alike.
- Spacing rhythm (proximity principle): Space above a heading must be ≥ 2× the space below (Heading 1: 56px/24px, Heading 2: 44px/18px), ensuring the heading clearly "belongs" to the following text rather than floating in the middle; 20px between paragraphs; ≥ 48px before/after major section switches (Numbered Separator).
- Three-tier color system: Heading color (darkest), body main color, secondary text (notably lighter and smaller); use only these three grayscale levels + the theme color across the whole article; do not mix other text colors.
- Scan-reading priority, dual-layer annotation (mandatory): A reader should be able to grasp the article's core information just by looking at "headings + highlights + bolds"; this is the formatting pass/fail line.
- Highlighted annotations (colored background) = core conclusions, key concepts: max 2 per paragraph, covering 5–10% of the total article characters.
- Bold keywords (no background, using highlight text color) = secondary emphasis, terms, data, action words: Every paragraph over 60 characters must mark at least 1 bold, long paragraphs 2–3, ensuring each screen has a visual anchor.
- Before output, perform a scan-reading test: Covering the plain text and looking only at annotations, can you retell the article's main thread? If not, go back and add more marks.
- Quote Card / Key Points Card: max one per screen (approx. 500 characters) to avoid overusing large components.
- Long paragraphs must be split: If a single paragraph exceeds 120 characters (about 4 lines), it must be split into two paragraphs or converted to a List Card / Step Timeline; after 3 consecutive plain text paragraphs, insert a visual component (Card, Quote, Number Highlight, or Image placeholder).
- Cards are for content, not for headings: Info Cards, List Cards, etc., should only carry "point summary" content; if they appear consecutively, they must be separated by normal paragraphs to avoid the whole screen becoming a blur of cards.
- Before output, read through the structure: Collapse the body text, look only at headings and cards; you should be able to reconstruct the article outline. If you can't, the hierarchy has failed and must be reworked.
Preservation Principle
- Do not delete any text content, do not rewrite semantics (unless the user explicitly requests polishing).
- Maintain the original logical order and paragraph separation.
- Large components (Quote Card / Key Points Card) should be used sparingly; at least one normal paragraph must separate two consecutive cards. However, inline annotations (highlights + bolds) are a minimum requirement, not a maximum; follow the "scan-reading priority" rule, and do not skip marks due to restraint.
Output Requirements
- Output the complete HTML code block directly, from the outer
<section>to the standard ending. - If the user requests saving to a file, write to
排版-{标题}-{主题}-{风格}.html. - After output, explain in 1-2 sentences (in Chinese) the theme, style, and components used, and suggest that the user can re-format with different themes or styles.