Recently, I started reading the enlightening book by Bob Doto on adopting the Zettelkasten methodology for capturing ideas and thinking creatively.
In the opening chapters, Bob describes the different types of notes you could take, one of them being reference notes.
Reference notes are single, long notes of brief citations or “references” to what caught your attention whilst reading a book, or consuming other forms of media.
I do the majority of my reading on my beloved Kindle and, after reading the section of Bob’s book on reference notes, I wondered how I could optimally capture passages of interest from my Kindle and turn them into something tangible to revisit and store in my Zettelkasten.
I do appreciate that a notepad is sometimes best, as there’s a little cognitive magic that happens when we humans put pen to paper - but I’m using an electronic device for reading and I’m lazy enough to want to take advantage of that through some form of automation.
I shelved (virtually) Bob’s book to ponder.
The Kindle has a feature that allows you to highlight passages of text as you’re reading. You can also add notes to these highlights whilst using the device.
These highlights and notes are stored on the Kindle in a plain text file found at: <kindle_root>/documents/My Clippings.txt
. This file can be accessed by plugging the Kindle into your computer via USB.
We have a data source.
I’ve opted to maintain a digital Zettelkasten under a fresh “vault” in Obsidian - a program I’ve been using for quite some time for note taking, and my own personal [chaotic] brand of journalling.
Obsidian stores every note as a markdown file on your computer’s filesystem.
My thinking here was to find a way to parse the clippings file found on the Kindle and process it into a markdown file, which I can save to the part of my filesystem that is used by Obsidian.
Ideally the contents of the output would be uniform, conforming to some template that makes sense to me when revisiting the highlights and notes. Bob illustrates a potential format in his book, I decided to try and emulate that.
I’ve created a small Command Line Interface (CLI) application, “Kindle to References” or KTR, to address my requirements.
I chose to write it in Rust because it’s a language I’ve been yearning to build something in for a little while, since going through 100 Exercises in Rust.
I’ve had a wonderful experience with Rust, though you could argue that what I’ve built has almost no complexity to it and would be a simple creation in any language.
As a user of the CLI application, you supply the path to your clippings file and a path to an output directory. Hitting enter will result in a set of markdown files, one for each book you have highlights and/or notes for, in your output directory.
These files can then be read by/imported into Obsidian:
The above image shows an example of the output format in Obsidian. KTR’s default template will create a table listing the page number that a highlight was captured in.
The description column is where any related notes made on the Kindle will appear, or provide a space to add thoughts after reading a book. This column will always contain a footnote reference link to the highlighted content.
The final column will always be empty, no matter what you do on your Kindle - it’s a space intended for tagging and/or linking thoughts to others in your Zettelkasten.
At the bottom of the page will be a numbered list of the highlighted content. These are the footnotes that are linked to in the table - Obsidian has a nice feature where you can hover your mouse over an internal link and a small window showing the content will pop up. I’ve tried to demonstrate that in the screenshot above - the mouse is missing, so you’ll have to take my word that I’m hovering it over the [1]
link in the first row of the table.
Whilst the application captures any notes that were added to highlights, I generally don’t take notes on my Kindle when highlighting text. This output file grants me an opportunity to revisit passages of text I found notable, add thoughts to them and also take advantage of Obsidian’s tagging functionality for linking references, thoughts and other notes together.
I feel that forcing myself to review the content I’ve highlighted might help embed my thoughts further - there’s no science behind that thinking though.
As a treat, you can optionally supply a path to a template of your own to alter the structure of the output files to your liking. I chose to use Tera as the template engine because @LGUG2Z was raving about it to me on Mastodon.
I decided that the CLI wasn’t quite enough of a project and so built a Graphical User Interface (GUI) application too. It’s essentially a wizard style utility - next, next, next…
The ELM Architecture was only something I had read about. Building this small application let me dip my toes into the heated pool of State, Messages, Update logic and View logic.
My application isn’t going to win any design or UX awards but it was fun to create. I got to dig into the (Iced) library’s documentation and source code to understand how things hang together, giving me experience of reading through a much more complicated Rust project. Again, I had a wonderful time.
The GUI application has an additional feature over the CLI - you can choose which books to process, rather than processing them all each time.
Whether using the CLI, or the GUI - the end result is the same: A collection of one or more markdown files in an output directory - ready for use in Obsidian, or your favourite Markdown editor.
Obviously, I’ve built this tool for myself. I have chosen to make the code available over on my GitHub though - just in case anyone else finds it useful too.
In the code repository, there are unsigned binaries available for download. Your computer will likely complain about how untrustworthy I am as a developer, but you’re in control of your destiny, not your fancy calculator.
Anyway, now this has been created, I can go back to enjoying Bob’s book.
Comments
You can use your Mastodon account to comment on this post by commenting on this thread.