Design & media

Wechat Markdown Html Render

Try it

Render Markdown to polished HTML with WeChat-friendly typography and explicit theme layering. Use when users ask to convert Markdown articles to formatted HT...

What it does

Render Markdown files into standalone HTML with separate style layers: , , , and . Use to generate deterministic output and keep code-block visuals independent from text theme.

The skill document

Wechat Markdown Html Render

Overview

Render Markdown files into standalone HTML with separate style layers: basic-theme, text-theme, code-theme, and font-theme. Use scripts/render-markdown-html.js to generate deterministic output and keep code-block visuals independent from text theme.

Workflow

  1. Inspect site-mechanism notes in references/wechat-bmpi-analysis.md when the request mentions wechat.bmpi.dev.
  2. Install dependencies in the skill folder:
npm install
  1. Render Markdown, you can pick a text-theme and code-theme and font-theme according to article contents:
node scripts/render-markdown-html.js \
  --input /path/to/input.md \
  --output /path/to/output.html \
  --text-theme geek-black \
  --code-theme wechat \
  --font serif
  1. Validate that the output includes the four style blocks and that --text-theme and --code-theme can be changed independently.

Script Interface

  • --input: Markdown source file path (required)
  • --output: HTML output file path (required)
  • --text-theme: normal | orange-heart | geek-black | minimal-dark | gold-sea (optional, default gold-sea)
  • --code-theme: wechat | atomOneDark | atomOneLight | monokai | github | vs2015 | xcode (optional, default wechat)
  • --font: serif | sans (optional, default serif)
  • --title: Custom HTML title (optional)
  • --custom-css-file: CSS file used only when --text-theme custom (optional)

Notes

  • The script intentionally scopes markdown typography under #nice and syntax highlighting under .hljs/pre code selectors so code theme remains independent.
  • The output is standalone HTML and can be copied into downstream editors.

WeChat MP editor list normalization (built into the renderer)

The script applies two post-processing rules specifically to survive the WeChat 公众号 editor's non-standard HTML ingester. These are NOT optional — they're enabled for every render — but worth knowing when reviewing output or extending the script:

  1. Flatten … for leaf items. The MP editor drops the list marker (the 1. 2. 3. numbers, or • bullets) when a contains a block-level child like, and also inserts an extra blank row per item from the section's vertical margins. Fix: for that does NOT contain a nested/, the renderer unwraps the inner section and merges its typographic styles directly onto the . Items with nested sub-lists keep the section wrapper (their sub-list layout depends on it).

  2. **Zero whitespace at / boundaries and between sibling s.** The MP editor treats whitespace text nodes between siblings (and at the start/end of a /) as additional EMPTY list items, producing numbered/bulleted blank rows interleaved with the real ones. Newline-only stripping is NOT enough — spaces and tabs leak through and still trigger the bug. The renderer collapses all whitespace at those three positions: → first, → next, last → (and the same for ``).

Symptoms in the MP editor preview when either rule fails:

  • Rule 1 broken → no 1. 2. 3. markers, items show as plain paragraphs separated by blank rows.
  • Rule 2 broken → 1. (blank) / 2. real / 3. (blank) / 4. real / … — count of visual rows ≈ 2N + 1 for N real items.

If you copy text out of the MP editor and the markers are missing, that's a clipboard artifact (markers are CSS ::marker pseudo-elements, not text nodes) — verify in the editor's visual preview, not the copied text.

Related skills

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai22 installs8 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván559 installs18 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

More from mebusw

Browse all skills

Manage scheduled Zoom meetings, cloud recordings, and account users from agent workflows via Server-to-Server OAuth.

by mebusw21 installs1 stars

Use when user asks to "generate workshop outline", "create training agenda", "design course structure", "build workshop schedule", or requests help planning...

by mebusw23 installs1 stars

Generate engaging short video scripts (30s-3min) for social media platforms like WeChat Channels, Douyin, Xiaohongshu, TikTok, and Reels. Use when user asks...

by mebusw33 installs

Use when user asks to "write WeChat article", "create 公众号文章", "write media content", or needs engaging articles for WeChat Official Accounts. Applies Pyramid...

by mebusw27 installs

Use Playwright via Bash `exec` tool (not the built-in browser tool) to fetch GasBuddy fuel prices for a target city/area (especially Toronto/North York), and...

by mebusw12 installs

Audit and improve existing Agent Skills (SKILL.md files) against the agentskills.io standard. Use this skill whenever the user wants to optimize, polish, imp...

by mebusw6 installs