Kindle Highlights to Markdown
Usage
This Python-based app is used to convert your Kindle Highlights to standalone files written in Markdown (.md).
Use this app get your highlights and notes sorted by Chapter and display the different Sections/ Headings/ Subheadings and important quotes (Check the sample html here).
In order to do that, you have to highlight some additional items while reading the book:
Highlight chapter title and add note "Chapter X", where X is the number of the Chapter
Highlight sections/part titles and add note "Section X" or "Part X"
Highlight chapter subheadings and add a note starting with "#" or "heading"
Highlight important sentences or further sub-subheadings and add a note starting with "##" or "subheading" or "important". This item will be displayed in bold
Highlight words depicting special chapters (foreword, preface, introduction, ...) and write the same word as a note
Highlight a paragraph or sentence depicting a chapter summary and add a note starting with "chapsummary", a "Chapter Summary" subtitle will automatically be created when the file is generated
Highlight text and take notes as you do usually, but do not start your sentences with any words that are interpreted as a heading or the whole note will show up formatted as a heading: 'chapter','part','section','introduction','appendix','heading','foreword','prologue','postscript','epilogue', 'dedication','toc','conclusion','acknowledgements','notes','references','summary','chapsummary', 'subheading','#','important','preface'
Exporting Highlights to .md Files
These files can be printed/converted to HTML/PDF/EPUB/MOBI using the tools mentioned below.
Place the application in the folder where you want to keep your highlights (not necessarily where your Clippings.txt is placed)
Browse and find the folder where you keep your Kindle Highlights .txt file (Do not keep other .txt files in this folder as the application takes the last creates .txt file in that folder/sub-folders and uses it)
Load the clippings file
Select the books you want to export (click on the books to highlight your selection)
Choose your export options
Show/hide page numbers (if available in book)
Show/hide location numbers (if available in book)
Export an additional file that combines all the selected books
The app will create a Markdown folder in the current directory and put all the files inside
If you export the same file with different options, it is automatically overwritten
How to Open and Use .md Files
Option 1: Atom + Markdown Preview Enhanced
Getting started with Atom
Download and Install Atom
Install Markdown Preview Enhanced
Open .md file
Press "ctrl+shift+M" to show the markdown preview window
Right click -> Ebook -> epub / mobi / pdf / html export options
To edit the css (styling) of the markdown preview before saving:
Press "ctrl+shift+P" and type "Markdown Preview Enhanced: Customize Css"
Add blockquote { color: #000000; } to make the highlight text black instead of the default grey
You can copy and add the customizations I am using from here
Add any other style changes you want
To edit the metadata and table of contents of the epub file (to put it back on your kindle):
Open the epub in an ebook editor (I use Calibre and its editor)
Change the book title in the book metadata
Edit the ebook and generate a TOC from all headings and save it to the file
(Optional) convert the ebook to azw3/mobi
Send ebook to device
Changing the Default Headings (v2.0)
You can change the default heading in the newly added menu after you load the latest clippings file.
Words used as heading must me entered as a list of strings, in the following format ['word1','word2']
If you decide to use repeating characters (e.g. #, ##, ###) to signify different levels of titles, please make sure to start with the # as the heading, ## as sub-heading and ### for important sentences. If you use the characters in reverse order (### for heading, ## for sub-heading, etc.) the app automatically matches all the entries to headings.