Skip to main content

Markdown to WeChat Public Account HTML converter

Project description

Xie

Convert Markdown to WeChat-compatible HTML with a single command. Works as a CLI tool, Python library, GUI app, or web service.

Why

If you write in Markdown and publish to WeChat, you know the pain of formatting. WeChat only accepts a limited subset of HTML, so most Markdown-to-HTML converters produce code that just won't paste correctly.

Xie handles this for you. It outputs clean, WeChat-compatible HTML with proper inline styles that paste directly into the WeChat editor.

Quick Start

# Install
pip install xie

# Convert a file
xie input.md -o output.html

# Or pipe content
echo "# Hello" | xie

Installation

# From PyPI
pip install xie

# With GUI and web support
pip install xie[all]

# From source
git clone https://github.com/cycleuser/xie.git
cd xie
pip install -e .

Three Ways to Use

CLI

# Basic conversion
xie article.md -o article.html

# With standalone document (includes title, author, styles)
xie article.md --standalone --title "My Post" --author "John" -o article.html

# Programmatic JSON output
xie article.md --json > result.json

Python Library

from xie import convert

result = convert("# Hello\n\nThis is **bold** text", standalone=True)
if result.success:
    print(result.html)

GUI or Web

# Launch desktop GUI
xie gui

# Start web server
xie web --port 5000

The web interface opens at http://localhost:5000. Write Markdown on the left, see the WeChat preview on the right, and click "Copy for WeChat" to grab formatted HTML ready to paste.

Features

Xie supports the standard Markdown things: headers, bold, italic, links, images, code blocks, tables, blockquotes, lists.

It also handles:

  • Syntax highlighting for code blocks. Xie uses Pygments to highlight 100+ languages, with colors applied as inline styles (no external CSS).
  • LaTeX math via $inline$ and $$block$$ syntax.
  • WeChat-specific styling on links, images, and code blocks that matches WeChat's appearance.

Supported Syntax

# Headers        **bold**       *italic*      ~~strikethrough~~
[links](url)    ![images](url)  `code`        ```language blocks
> quotes         - lists         1. lists      | tables |
$math$          $$block math$$

WeChat Compatibility

WeChat doesn't accept arbitrary HTML. Xie only outputs tags and styles that WeChat allows:

  • All styles are inline (no <style> tags or CSS classes)
  • Link color defaults to WeChat blue (#576b95)
  • Images scale responsively
  • Code blocks use inline colors instead of external stylesheets

Requirements

  • Python 3.8+
  • mistune for Markdown parsing
  • Pygments for code highlighting

Optional: PySide6 for GUI, Flask for web server.

License

GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xie-1.0.1.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xie-1.0.1-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file xie-1.0.1.tar.gz.

File metadata

  • Download URL: xie-1.0.1.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for xie-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0d4924c3e30840aa8687020b1d9d3538a561132e9e519f03dc12b49f44dceeef
MD5 950c51008f225afda1ec12e5b2d50b25
BLAKE2b-256 5b24665d1d27201e3de3d0f6bc217039b37eee8315b91ddba71aa57f6eb3ff10

See more details on using hashes here.

File details

Details for the file xie-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: xie-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for xie-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08aa90414433373accdc738c14bdeb7faa5376c4c0659d1b1823810004de5915
MD5 cd16bf8e236496ec29587ecd2f6293e4
BLAKE2b-256 632e4cb6839adf325454adf68ea02824af139a1e02bd400fd3c640e50d117a04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page