# Epub Chinese Cleaner

> Use when a user wants to convert a Chinese epub from vertical layout (直排) or RTL page flow to standard horizontal reading.

- Skill: `william-yeh/epub-chinese-cleaner` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add william-yeh/epub-chinese-cleaner`
- Raw SKILL.md: https://api.skillmd.com/api/skills/william-yeh/epub-chinese-cleaner/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: william-yeh (https://skillmd.com/u/william-yeh)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/william-yeh/epub-chinese-cleaner

---


# epub-chinese-cleaner

Converts Chinese epub files from vertical (直排) + RTL page flow to horizontal (橫排) + LTR page flow.

## What it does

1. **Detects** whether the epub needs conversion (checks CSS `writing-mode` and OPF `page-progression-direction`)
2. **Converts writing mode** from `vertical-rl` to `horizontal-tb` (including vendor prefixes)
3. **Normalizes punctuation** from vertical Unicode forms to horizontal equivalents
4. **Fixes page direction** by removing `page-progression-direction="rtl"` from OPF spine
5. **Preserves original** — outputs a new file with `_horizontal` suffix

## Usage

Ask the agent to convert an epub by name or description:

- "Convert `三體.epub` to horizontal layout"
- "This epub has vertical text, can you make it horizontal?"
- "Check if `book.epub` needs conversion"

The agent runs:

    python3 scripts/convert_horizontal.py <input.epub>

Output is `<input>_horizontal.epub`. The script auto-detects whether conversion is needed and uses direct manipulation by default, falling back to Calibre if direct manipulation fails.

## Punctuation mapping

See [references/punctuation-map.md](references/punctuation-map.md) for the full vertical → horizontal punctuation mapping.

