AI Agent Hub
Back to skills
Markdown to WeChat Publisher HTML icon

Markdown to WeChat Publisher HTML

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_fd308b11/markdown-html-wechat following the guide at https://skillhub.cn/install/skillhub.md.

About this skill

The Problem It Solves

Publishing Markdown content to WeChat Official Accounts presents a specific formatting challenge: the WeChat editor requires all CSS styles to be inlined directly into HTML tags. A straightforward copy-paste from a rendered Markdown preview loses all styling, while manually writing inline CSS is tedious, error-prone, and hard to maintain. This is especially cumbersome for content with code blocks, tables, or specific layout requirements.

How The Skill Works

This skill provides a lightweight Node.js script to automate the entire conversion from Markdown to "paste-ready WeChat HTML." Its core capabilities and key steps are:

  • Automated Conversion & Inlining: The script processes an input .md file and a specified CSS theme file (e.g., resources/themes/default.css). It generates HTML from Markdown and automatically inlines all the CSS styles into each HTML element, satisfying WeChat's requirements.
  • WeChat-Specific Adaptation: The script automatically wraps the output in a WeChat container (<section id="nice">...</section>) for better compatibility within the editor. It also processes CSS variables defined in the theme to allow for shared color schemes across multiple themes.
  • Zero-Configuration Dependencies: When executed, the script loads all required dependencies into a temporary directory, performs the conversion, and then cleans up completely. The user only needs Node.js installed in their environment; there is no need to run npm install beforehand, enabling a true "out-of-the-box" experience.
  • Theming Support: "Skin switching" is straightforward by simply changing the path of the CSS file passed to the script (files located in resources/themes/), allowing for different visual styles with minimal effort.

Scope and Important Notes

  • Theme Variables: The current theme system uses CSS variables (e.g., --text-color). If you later use this output with other publishing tools (like zhy-wechat-publish) to upload to WeChat drafts, ensure the tool can expand these variables before upload to prevent style loss.
  • Runtime Environment: Although the script handles dependencies automatically, the execution environment must have Node.js installed.
  • Content Preview & Publishing: The generated HTML file can be opened directly in a browser to preview the final layout. To publish, you must select all content in the browser page and copy-paste it into the WeChat Official Account rich text editor.
  • Input Source: This skill processes standard Markdown text. The input must be a .md file.

Use Cases

  • A technical blogger finishes an article in Markdown format and needs to quickly publish it to their WeChat Official Account, requiring correct styling for code blocks, tables, and other elements to match their blog's appearance.
  • A product team has written release notes in Markdown and needs to convert them into a WeChat post to notify users via internal channels, demanding clean formatting that is ready to paste and publish.
  • A community manager wants to compile chat logs or discussion highlights from a group into a WeChat article for review. They can first organize the content in Markdown and then convert it for publication.
  • A personal learner uses Markdown to take reading notes or course summaries and wishes to publish key highlights on their personal WeChat account for knowledge consolidation and sharing.

Best For

  • Technical Blog Authors: Need to publish Markdown-written technical articles to WeChat Official Accounts with zero-cost adjustment, preserving the original layout of code examples and documentation.
  • Content Marketers or Product Team Members: Regularly need to convert Markdown-formatted product documents, changelogs, or internal reports into publicly publishable WeChat Official Account articles.
  • Community Managers: Need to quickly organize and format fragmented content like group discussions and user feedback into a well-structured WeChat post.
  • Independent Content Creators or Personal Note-Takers: Use Markdown as their daily writing tool and want its content to be easily ported to the WeChat Official Account platform with aesthetically pleasing formatting.