Convert O’Reilly highlights csv to Markdown. Then use them in your Jekyll blog as a collection
Find the script here Highlights to Markdown, enjoy!
I’m lucky to have an O’Reilly subscription paid by my employer (thank you Trainline!). When reading books from the tablet, I like highlighting interesting stuff all the time. It’s my way of filtering the most important information and re-read it when needed. But how can I extract this data?
🕵️ Getting the csv file
Going to my O’Reilly profile, I realized all the highlights I made were stored there. There is a link to export them as a csv file:
💻 Reusing previous script
Recently, I created an script to parse the highlights from Kindle so I decided to extend it to support O’Reilly too.
Converting the csv to an object was a different process than in kindle since the source is a txt file. But once I have an object I could reuse the logic that creates the Markdown file. Check out the resulting code in Highlights to Markdown. In the books section there are already some O’Reilly highlights added like The Art of Unit Testing.
🔑 Key differences
- The csv includes the chapter were the highlight was made, giving more context than in the Kindle file
- For an unkown reason, the csv file does not include the author of the book, it has to be added manually.
When reading from the Kindle app instead of a Kindle device, another kind of file can be generated. It’s HTML instead of txt. It will be my next update to this script. I’ll keep you posted!
Leave a comment