Skip to content
Back to search

claude-epub-skill

SkillWorks with Claude CodeGitHub

A Claude Skill for converting markdown documents, chat summaries, or research reports into a downloadable epub file that can be sent to kindle

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/smerchek--claude-epub-skill/badge.svg)](/listings/smerchek--claude-epub-skill)

HTML

<a href="/listings/smerchek--claude-epub-skill"><img src="/api/listings/smerchek--claude-epub-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- Python 3.8+ - pip (Python package manager)

Setup

1. **Install dependencies:**

   pip install -r markdown-to-epub/requirements.txt

2. **Verify installation:**

   python test_epub_skill.py

You should see all tests pass: - ✓ Markdown processing: PASSED - ✓ EPUB generation: PASSED - ✓ Edge cases: PASSED

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 259 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Markdown to EPUB Claude Skill
  2. A Claude agent skill that converts markdown documents and chat summaries into professional EPUB ebook files. Perfect for creating portable, device-agnostic ebooks from research documents, blog posts, articles, or conversation summaries.
  3. ## Overview
  4. This skill transforms markdown content into EPUB3 format ebooks that work across all major reading platforms:
  5. - Apple Books
  6. - Amazon Kindle (via Kindle reading apps)
  7. - Google Play Books
  8. - Kobo
  9. - Any standard EPUB reader
  10. ## Features
  11. ✨ **Markdown Processing**
  12. - Automatic chapter detection from H1 headers
  13. - Automatic section parsing from H2-H6 headers
  14. - Full markdown formatting support (bold, italic, links, lists, code blocks, etc.)
  15. - **Enhanced code blocks** with premium monospace fonts and syntax highlighting support
  16. - **Professional tables** with styled headers and alternating row colors
  17. 📚 **EPUB Generation**
  18. - EPUB3 standard compliance
  19. - Automatic table of contents with proper navigation
  20. - Responsive, device-agnostic styling
  21. - Proper document structure and metadata
  22. - Beautiful code formatting for technical documents
  23. 🎯 **Smart Input Handling**
  24. - Accept raw markdown text directly
  25. - Process markdown files by path
  26. - Extract metadata from YAML frontmatter
  27. - Handle edge cases gracefully
  28. ## Project Structure
  29. ```
  30. markdown-to-epub/
  31. ├── SKILL.md # Skill definition with YAML frontmatter
  32. ├── requirements.txt # Python dependencies
  33. ├── scripts/
  34. │ ├── markdown_processor.py # Markdown parsing & structure extraction
  35. │ ├── epub_generator.py # EPUB file creation & formatting
  36. └── resources/
  37. └── default_styles.css # (future) Custom EPUB styling
  38. test_epub_skill.py # Test suite with sample content
  39. ```
  40. ## Installation
  41. ### Prerequisites
  42. - Python 3.8+
  43. - pip (Python package manager)
  44. ### Setup
  45. 1. **Install dependencies:**
  46. ```bash
  47. pip install -r markdown-to-epub/requirements.txt
  48. ```
  49. 2. **Verify installation:**
  50. ```bash
  51. python test_epub_skill.py
  52. ```
  53. You should see all tests pass:
  54. - ✓ Markdown processing: PASSED
  55. - ✓ EPUB generation: PASSED
  56. - ✓ Edge cases: PASSED
  57. ## Usage
  58. ### Basic Python Usage
  59. ```python
  60. from markdown_to_epub.scripts.epub_generator import create_epub_from_markdown
  61. markdown_content = """
  62. # My Book
  63. ## Chapter 1
  64. Content here...
  65. """
  66. # Generate EPUB
  67. create_epub_from_markdown(
  68. markdown_content,
  69. output_path="my_book.epub",
  70. title="My Book",
  71. author="John Doe"
  72. )
  73. ```
  74. ### With Claude Skills Framework
  75. When registered as a Claude skill, simply ask Claude to convert markdown to EPUB:
  76. ```
  77. "Convert this markdown to an EPUB ebook:
  78. # Research Summary
  79. ## Introduction
  80. ...content..."
  81. ```
  82. Or provide a file path:
  83. ```
  84. "Convert the markdown file at research_notes.md to an EPUB file"
  85. ```
  86. ## Markdown Support
  87. | Element | Example | Support | Styling |
  88. |---------|---------|---------|---------|
  89. | Headers | `# H1` through `###### H6` | Full | Optimized sizes for e-readers |
  90. | Bold | `**bold**` or `__bold__` | Full | Strong emphasis |
  91. | Italic | `*italic*` or `_italic_` | Full | Subtle emphasis |
  92. | Links | `[text](url)` | Full | Clickable |
  93. | Lists | `- item` or `1. item` | Full | Proper indentation |
  94. | Code Blocks | ` ```language ` | **Enhanced** | Monospace fonts, styled backgrounds, blue accent |
  95. | Inline Code | `` `code` `` | **Enhanced** | Gray background, subtle border |
  96. | Tables | Markdown tables | **Enhanced** | Blue headers, zebra striping, responsive |
  97. | Blockquotes | `> quote` | Full | Blue left border |
  98. | Horizontal Rule | `---` or `***` | Full | Subtle divider |
  99. | Paragraphs | Text with blank lines | Full | Justified text |
  100. ## YAML Frontmatter Support
  101. Add metadata to your markdown using YAML frontmatter:
  102. ```markdown
  103. ---
  104. title: My Ebook
  105. author: John Doe
  106. language: en
  107. date: 2025-01-15
  108. ---
  109. # Chapter 1
  110. ...
  111. ```
  112. Supported fields:
  113. - `title` - Book title
  114. - `author` - Author name
  115. - `language` - Language code (default: `en`)
  116. - `date` - Publication date
  117. ## Architecture
  118. ### MarkdownProcessor (`markdown_processor.py`)
  119. - Parses markdown into structured chapters and sections
  120. - Extracts metadata from YAML frontmatter
  121. - Builds table of contents
  122. - Converts markdown to HTML
  123. - Handles edge cases (empty content, special characters, etc.)
  124. ### EPUBGenerator (`epub_generator.py`)
  125. - Creates valid EPUB3 files using ebooklib
  126. - Manages book metadata and document structure
  127. - Applies consistent styling via embedded CSS
  128. - Generates navigation documents (NCX, NAV)
  129. - Handles proper spine/TOC setup
  130. ## Dependencies
  131. - **ebooklib** (0.18.0) - EPUB file creation and manipulation
  132. - **markdown2** (2.4.12) - Markdown utilities (included for future enhancement)
  133. ## Testing
  134. Run the comprehensive test suite:
  135. ```bash
  136. python test_epub_skill.py
  137. ```
  138. Tests include:
  139. - Markdown parsing with various header structures
  140. - EPUB file generation and validation
  141. - Edge cases (empty content, plain text, special characters)
  142. - Long documents (10+ chapters)
  143. - Table of contents generation
  144. - Metadata extraction
  145. ## Future Enhancements
  146. 🎨 **Cover Page Generation**
  147. - Auto-generate title pages with styling
  148. - Custom cover images with MCP integration
  149. 📱 **Kindle Support**
  150. - .mobi and .azw3 format generation
  151. - Kindle-specific optimizations
  152. - Direct Kindle device upload capability
  153. 🎨 **Advanced Styling**
  154. - Custom CSS per user preferences
  155. - Custom fonts
  156. - Advanced typography controls
  157. 📚 **Multi-Document**
  158. - Merge multiple markdown files
  159. - Cross-document references
  160. - Advanced chapter organization
  161. ## Technical Details
  162. - **EPUB Version**: EPUB3 (2023 standard)
  163. - **HTML Standard**: XHTML 1.1
  164. - **Character Encoding**: UTF-8
  165. - **CSS Support**: Responsive, embedded styling
  166. - **Navigation**: NCX (compatibility) + NAV (EPUB3 standard)
  167. ## Troubleshooting
  168. **EPUB won't open**
  169. - Verify markdown uses proper syntax
  170. - Check for balanced brackets in links
  171. - Ensure chapters have H1 headers
  172. **Missing table of contents**
  173. - Add H1 headers to mark chapter boundaries
  174. - Verify headers are followed by content
  175. **Formatting looks different**
  176. - This is normal! EPUB readers apply their own fonts and styling
  177. - Structure is preserved across all readers
  178. **Large file size**
  179. - Compress with external tools if needed
  180. - Remove large embedded content if applicable
  181. ## License
  182. This skill follows the same license as the Claude Cookbooks project.
  183. ## Contributing
  184. Contributions are welcome! Areas for improvement:
  185. - Additional markdown features (tables, footnotes)
  186. - Enhanced styling options
  187. - Performance optimizations
  188. - Additional format support
  189. ## Related Resources
  190. - [EPUB 3 Standard](https://www.w3.org/publishing/epub32/)
  191. - [Claude Skills Documentation](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/)
  192. - [ebooklib Documentation](https://docs.sourcefabric.org/projects/ebooklib/)
  193. - [Markdown Syntax](https://www.markdownguide.org/)
  194. ---
  195. **Created**: 2025-01-16
  196. **Version**: 1.0.0
  197. **Status**: Production Ready

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.