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.2.tar.gz (35.4 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.2-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xie-1.0.2.tar.gz
  • Upload date:
  • Size: 35.4 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.2.tar.gz
Algorithm Hash digest
SHA256 b11d2bafb484d9d922a14107f37ec47b511fd27d73724f6f6cfa0d01d9fa160f
MD5 74acbcc4ee94acb6c6d658a452d976bc
BLAKE2b-256 949c35e343ddba729eb722f5ac03636a8fc81d4bd752231e6b85c5b15fd0d749

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xie-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 31.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf992683529ddadd248cf6729bd9ff1e3dc38fa9de68418b956136b44c35a2c1
MD5 01734577453edf46e38405a5bda6e7cd
BLAKE2b-256 de3890b7019813f3e3971a42b2a94ceb6577a1199446c011316338555b15ef23

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