Skip to content
Back to skills

Md To Epub

ASecurity

Convert Markdown files, specs, or documentation folders into clean, Kindle and E-Ink optimized EPUB 3 e-books that pass Amazon Send-to-Kindle conversion. Use when the user asks to turn Markdown into an EPUB, prepare a document for Kindle/e-reader reading, or package technical docs with tables, code blocks, callouts, footnotes, or Mermaid diagrams into an e-book.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongobashapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add mrmike/md2kindle --skill md-to-epub --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Md To Epub?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Md To Epub
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mrmike-md-to-epub/badge)](https://www.skillsdirectory.com/skills/mrmike-md-to-epub)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: md-to-epub
description: >-
  Convert Markdown files, specs, or documentation folders into clean,
  Kindle and E-Ink optimized EPUB 3 e-books that pass Amazon
  Send-to-Kindle conversion. Use when the user asks to turn Markdown into
  an EPUB, prepare a document for Kindle/e-reader reading, or package
  technical docs with tables, code blocks, callouts, footnotes, or Mermaid
  diagrams into an e-book.
license: Apache-2.0
compatibility: >-
  Requires Python 3.9+ (stdlib only; zero required dependencies). Optional:
  mmdc or merman-cli for offline Mermaid PNG rendering; Pillow for transparent
  PNG flattening and screen-fit image downscaling; network access if using
  Kroki/mermaid.ink remote Mermaid rendering.
metadata:
  author: md2kindle
  version: "1.0.0"
---

# Markdown to Kindle-Ready EPUB 3

Convert one or more Markdown files (or a directory of `.md` files) into a validated, E-Ink–friendly EPUB 3 file tailored for Kindle displays and Amazon's Send-to-Kindle (KFX) converter.

## Procedure

1. **Locate inputs and output path**
   - Identify the Markdown file(s) or folder to convert and choose an output `.epub` path (defaults to `<input>.epub`).
   - Check if the user wants a custom `--title`, `--author`, `--cover`, `--screen-size`, or `--offline` mode (private docs should use `--offline` or `--mermaid local` so Mermaid diagram source is not sent to remote rendering APIs).

2. **Run the converter script**
   Execute [scripts/md_to_epub.py](./scripts/md_to_epub.py) with Python 3:
   ```bash
   python3 scripts/md_to_epub.py <input.md> -o <output.epub>
   ```
   Useful flags:
   - `--title "My Spec"` / `--author "Name"` — override inferred frontmatter/H1 metadata.
   - `--split-level 2` (default) — splits single Markdown files on H1/H2 into Kindle chapters with TOC entries (`0` = single chapter, `1` = H1 only).
   - `--screen-size standard` (default) — sets Kindle screen-size class for auto table reflow, Mermaid PNG sizing, and optional Pillow image downscaling (`compact` = 6" / 1072×1448, `standard` = 7" / 1264×1680, `large` = 10"+ / 1860×2480).
   - `--table-mode auto` (default) — automatically turns wide tables into stacked key-value cards sized to `--screen-size` (`cards` or `table` to override).
   - `--mermaid auto|local|kroki|ink|none` — renders Mermaid fenced blocks to opaque-white PNGs (`local` uses `mmdc`/`merman-cli`; `auto` falls back to Kroki POST API unless `--offline` is passed; always falls back safely to a code block on failure).
   - `--code-wrap 0|auto|N` — hard-wrap long code lines (`0` = soft CSS `pre-wrap` [default]; `auto` = match `--screen-size`; or explicit column count like `52`).
   - `--cover path/to/cover.jpg` — embed a raster cover image (sets both EPUB 3 `cover-image` and EPUB 2 `<meta name="cover">`).

3. **Verify validation output**
   - Built-in validation runs automatically by default and checks:
     - `mimetype` is entry 0, uncompressed (`ZIP_STORED`), empty extra field, exact `application/epub+zip`.
     - Every `.xml`, `.opf`, `.ncx`, and `.xhtml` file is well-formed UTF-8 XML without BOM or named entities like `&nbsp;`.
     - Both `nav.xhtml` (EPUB 3) and `toc.ncx` (Kindle Go-To TOC) exist.
     - No Kindle E016 hazards (`<menclose>`).
   - If the user wants to deliver the generated `.epub` to their Kindle, hand off to the optional `send-to-kindle` skill (if installed) or provide the local path for `amazon.com/sendtokindle`.

## Reference

- For detailed Amazon Send-to-Kindle KFX rules, E-Ink CSS constraints, pop-up footnotes, and diagram tips, read [references/kindle-epub-guide.md](./references/kindle-epub-guide.md).

Files in this skill

  • SKILL.md3.2 KB
  • agents/openai.yaml225 B
  • references/kindle-epub-guide.md1.7 KB
  • scripts/md_to_epub.py49.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.