Mobi to markdown
A collection of reusable AI agent skills for everyday use.
npx -y skills add tejask0/agent-skills --skill mobi-to-markdownAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 20 days oldThe repository was created 20 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when converting a MOBI, AZW3, or EPUB ebook into a clean Markdown note (e.g. for Obsidian) — covers Calibre ebook-convert, why pandoc produces HTML soup, adding YAML frontmatter, and promoting chapters to headings.
SKILL.md
2.8 KB, as published. Nobody here has run it
MOBI → Markdown
Overview
Convert an ebook to clean, readable Markdown suitable for an Obsidian vault. Use Calibre's ebook-convert, not pandoc — pandoc on an ebook with no semantic headings emits raw <span>/<svg> HTML soup; Calibre's Markdown writer produces clean output directly.
Prerequisites
ebook-convert(Calibre). Check:ebook-convert --version. Install:sudo apt install calibre.
Steps
1. Convert
Calibre has no md output plugin — Markdown is produced by the TXT writer with --txt-output-formatting markdown. Output to .txt, then rename:
ebook-convert "input.mobi" "output.txt" \
--txt-output-formatting markdown \
--keep-links --keep-image-references
mv "output.txt" "output.md"
Italics, blockquotes, and numbered entries carry over intact. (--keep-links/--keep-image-references only take effect with a non-none formatting option.)
2. Add YAML frontmatter + H1
Prepend metadata so the note is searchable and shows a title:
---
title: <Title>
author: <Author>
translator: <if any>
publisher: <if any>
source: <input>.mobi (converted)
tags: [book, <topic>]
---
# <Title>
*<subtitle / edition line>*
3. Promote chapters to ## headings
Ebooks navigate by an internal TOC, so chapter titles often land as plain bold/paragraph text. Promote each (Introduction, every Book/Chapter, Notes, Index) to ## so Obsidian's outline panel works. Add subtitles where the edition has them.
4. Clean up
- Drop the duplicate title/TOC block at the top — heading-based navigation replaces the publisher's TOC page.
- Collapse runs of blank lines.
- Keep Notes and Index sections at the end.
Common Mistakes
| Mistake | Fix |
|---|---|
| Using pandoc on the MOBI | Raw HTML soup; ebook has no semantic headings. Use ebook-convert. |
Output file named .md directly | No md output plugin — ValueError: No plugin to handle output format: md. Output .txt, then rename. |
| Leaving chapters as bold text | Obsidian outline is empty; promote to ##. |
| Keeping the original TOC page | Redundant with headings; delete it. |
| Case-only filenames in vault | Foo.md+foo.md collide on Mac/Android via Syncthing; name uniquely. |
Reference output
Running this on a full-length public-domain classic (e.g. a well-known philosophy or literature text with a modern translation) typically produces: YAML frontmatter, every Book/Chapter plus Introduction/Notes/Index promoted to ##, original front-matter TOC removed, and a few thousand lines of clean Markdown.