| name | kindle-import |
| description | Import reading notes from Kindle HTML exports into the slipbox. Use when the user sends a Kindle notebook export file (HTML/XHTML, including Telegram forwards as application/xml or text/plain). |
Kindle Import
Parse Kindle notebook exports (HTML/XHTML) and create slipbox entries for the user's own notes.
Input Format
Kindle exports are XHTML files with this structure:
<div class="bookTitle">Book Title Here</div>
<div class="authors">Author Name</div>
...
<div class="sectionHeading">Chapter/Section Name</div>
<div class="noteHeading">Highlight (yellow) - Section > Page X</div>
<div class="noteText">Highlighted text from book</div>
<div class="noteHeading">Note - Section > Page X</div>
<div class="noteText">User's own note</div>
noteHeading starting with "Highlight" → book text → skip
noteHeading starting with "Note" → user's own thoughts → import the following .noteText
- Section/page info in the heading (e.g., "Section > Page 28") → ignore
Metadata fields:
- Title: content of
.bookTitle div
- Author: content of
.authors div
- Source type:
book
Workflow
- Parse header → extract book title and author. Done when title and author are both captured.
- Extract user notes → collect the
.noteText following every noteHeading starting with "Note"; decode HTML entities in each noteText before passing to slipbot. Done when every Note heading in the file has its following noteText accounted for.
- Precheck → show user: book title, author, note count, ask for confirmation. Done when user confirms (or aborts).
- On confirmation → for each note, invoke slipbot:
- Type: note (
- prefix)
- Source:
~ book, {title} by {author}
- Let slipbot handle: filename, tags, links, graph update
- Report → count of notes created. Done when the reported count matches the extracted count.
Example
Input noteText:
Applications should not allow unsigned JWTs to be considered valid.
Slipbot call:
- Applications should not allow unsigned JWTs to be considered valid. ~ book, The JWT Handbook by Sebastian E Peyrott
Edge Cases
- No user notes (only Highlights): Report "no notes to import"
- Multiple authors: Preserve as-is from the file
- Missing author: Use "Unknown" as author
- Special characters in title/content: Preserve as-is