Skip to main content

Xie

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

Xie (写) means "to write" in Chinese.

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 convert test.md -o test.html

# Or pipe content
echo "# Hello" | xie

Installation

# From PyPI
pip install xie

# With web support
pip install xie[all]

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

Usage

CLI

# Basic conversion
xie convert test.md -o test.html

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

# JSON output
xie convert test.md --json

Python Library

from xie import convert_markdown_to_wechat

result = convert_markdown_to_wechat("# Hello\n\nThis is **bold** text")
if result.success:
    print(result.data['html'])

Web Service

# Start web server
xie web --port 5000

Open http://localhost:5000 in your browser. Write Markdown on the left, see the WeChat preview on the right, and click "Copy" to grab formatted HTML ready to paste.

Web Interface

Features

  • Full Markdown support: headers, bold, italic, links, images, code blocks, tables, blockquotes, lists
  • Syntax highlighting for code blocks with 100+ languages (Pygments)
  • LaTeX math via $inline$ and $$block$$ syntax
  • WeChat-compatible output: all styles inline, no external CSS

Supported Syntax

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

Example

Input (test.md):

# 一级标题

## 二级标题

**加粗**

* 分点1
* 分点2

> 引用

$$
\Sigma_e^t= \frac{1}{2}
$$

```python
print("hello")

Output: WeChat-compatible HTML with inline styles.

## Requirements

- Python 3.8+
- mistune (Markdown parsing)
- Pygments (code highlighting)
- Flask (optional, for web server)

## License

GPLv3

Metadata

Release files for xie 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xie 1.0.3
File Size Uploaded Provenance
xie-1.0.3.tar.gz 153.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for xie 1.0.3
File Interpreter ABI Platform
xie-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 185.0 kB

Release files / xie-1.0.3.tar.gz

Download URL xie-1.0.3.tar.gz
Size 153.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f8f046d401beb66155a6f366a0e0749f0ac6fc9b6ddd1ffd14f6109b2978c541
BLAKE2b-256 checksum
How to use checksums
8ca5d31e1895195f2e5fd160397c4e330f6697738191cc1f4618776207bd4716
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / xie-1.0.3-py3-none-any.whl

Download URL xie-1.0.3-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15df58776c39614b439f396942a168e64a097f838db4885dc183c52a5d948289
BLAKE2b-256 checksum
How to use checksums
e8c21d895d78f6630ec1c23c3cc774e3524d37de3cd183c6be6aa153286fbc3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for xie 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page