epub-to-markdown
Skill50 starsChanged 9 months agoMITView on GitHub
Convert EPUB files to well-formatted single markdown files with images extracted. Images are extracted with a book prefix derived from the title: - Title: "Die Empty: Unleash Your Best Work Every Day" - Prefix: DieEmptyUnleash (first 3 words, special chars removed) - Image: files/DieEmptyUnleash_cover.jpg This prevents filename collisions when extracting multiple books to the same folder. Or use requirements.txt:
- Installs packages
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Single file output: All chapters in one markdown file
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
EPUB to Markdown Skill
Convert EPUB files to well-formatted single markdown files with images extracted.
Usage
python3 epub_to_markdown.py "<epub_path>" -o "<output_path>"Features
- Metadata extraction: title, author, language, publisher, publication date
- TOC parsing: Extracts table of contents with hierarchy
- HTML to Markdown: Converts chapter HTML using html2text
- Heading preservation: Maintains H1-H6 hierarchy
- Image extraction: Extracts images to
_files_/folder with book prefix - Single file output: All chapters in one markdown file
Output Structure
output_dir/
├── book.epub # Original file
├── book.md # Extracted markdown
└── _files_/ # Images folder
├── BookTitle_cover.jpg
├── BookTitle_figure1.png
└── ...Image Prefix
Images are extracted with a book prefix derived from the title:
- Title: "Die Empty: Unleash Your Best Work Every Day"
- Prefix:
DieEmptyUnleash(first 3 words, special chars removed) - Image:
_files_/DieEmptyUnleash_cover.jpg
This prevents filename collisions when extracting multiple books to the same folder.
Output Format
---
title: {from metadata}
author: {from metadata}
language: {from metadata}
source_file: original.epub
source_type: epub
extracted: YYYY-MM-DD HH:MM:SS
status: extracted
---
# {Book Title}
## Table of Contents
- Chapter 1
- Chapter 2
...
---
## Chapter 1
{content with  links}
---
## Chapter 2
{content}Dependencies
pip install ebooklib beautifulsoup4 html2textOr use requirements.txt:
pip install -r requirements.txtOptions
| Flag | Description |
-o, --output | Output markdown file path (default: same as epub with .md) |
-q, --quiet | Suppress progress messages |
Limitations
- DRM-protected EPUBs: Cannot be extracted (will fail with error)
- Complex formatting: May simplify to plain text
- Large EPUBs: May take time for books with many chapters/images
In this repository21 other files it gives its agents.
- ai4pkm-helperSkill
- create-vlog-scriptSkill
- docx-to-markdownSkill
- gemini-image-skillSkill
- gobi-onboardingSkill
- interactive-writing-assistantSkill
- markdown-slidesSkill
- markdown-videoSkill
- obsidian-canvasSkill
- obsidian-cliSkill
- obsidian-linksSkill
- obsidian-markdown-structureSkill
- obsidian-mermaidSkill
- obsidian-yaml-frontmatterSkill
- remotion-narrated-video-essaySkill
- remotion-vlogSkill
- video-add-chaptersSkill
- video-cleaningSkill
- video-full-processSkill
- voice-clone-skillSkill
- youtube-transcript-summarizerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

