MoonReader hightlights import

Hi!

Just to share that by the end of 2024, I developed a script that extracts the entire Moon+ Reader database, and also retrieves chapter structures directly from the book files (via table of contents) when your library is synced to a cloud service. This makes it possible to link highlights to their exact chapters for both EPUB and PDF files.

It’s already solid, the only reason it’s not out yet is simply my limited time to prepare it for public release. My goal is to release it before the end of the year.

Important note: This won’t be an Obsidian plugin. It will be a command-line tool (CLI) that can be launched in one click via a simple script, and easily automated (for example, with cron). Personally, I run it automatically twice a day to keep my library perfectly up to date.

How it works ? All you really need to do is set up a configuration file to specify the location of the Moon+ Reader database, set up your templates, and then simply run the script.

Here’s a quick overview of the main features:

  • Full database extraction (books, highlights, notes, statistics, covers)

  • Chapter-based highlight linking (via table of contents extracted from each EPUB/PDF)

  • Multiple export modes (atomic notes per highlight or a single merged markdown file)

  • Fully automated processing (batch processing, timestamps, clean folder structure)

  • Customizable Markdown output (via Liquid templates to match your Obsidian setup)

  • Cover extraction (export each book’s cover image)

  • Multi-device backup merging (combine libraries and highlights from different devices)

  • Reading statistics:

    • Pages read per year (annual reading volume)
    • Complete list of reading sessions (start/end date, duration)
    • Reading habits overview (average reading time, preferred reading hours)
    • Annual reading summary (per year, month, or custom date range)
    • Per-author stats (how much you’ve read from each author)
    • Per-book stats (pages read, time spent, notes count)

And because the whole system is template-based, it will be easy to adapt it once the new “Bases” feature becomes public, so it could either keep generating static files as it does now, or work fully integrated with Bases in the future.

When it’s ready, I’ll be posting about it everywhere, here on this topic, on this forum, on Reddit, and other places where Moon+ Reader users hang out. And since it’s completely independent of Obsidian, I might also add the option to export to other simple formats like JSON in addition to Markdown.

Edit : Here are a few screenshots to give you an idea of what the tool looks like in action

Global reading stats view with plenty of metrics: Reading Patterns (Weekly Reading Habits, Monthly Reading Habits) & Reading Records (Top 10 Most Read Books, Top 10 Most Highlighted Books, Top 10 Longest Reading Days)
https://i.imgur.com/OEhYw4b.png

Reading view of the library showing the 5 most recently read books, plus the complete list with covers
https://i.imgur.com/rUbIM6r.png

Reading view of a book’s info page, on the left you can see the page’s TOC with the info section, highlights, and reading stats
https://i.imgur.com/28mS5Rk.png

Reading view of a book’s highlights section, I also extract the highlight type (highlighted, strikethrough, etc.) and color, with a small HTML preview
https://i.imgur.com/H5qlfMW.png

Markdown view of a book’s highlights section, as you can see, I chose atomic notes to make it easier to link to these notes from other pages
https://i.imgur.com/jvDYXN7.png

Folder structure created by the tool, even the paths are fully customizable
https://i.imgur.com/p2jtj7C.png

Author page showing their books and all reading sessions (complete stats and history)
https://i.imgur.com/L77DB9g.png

1 Like