yifan-gu / fyodor

Convert your Amazon Kindle highlights and notes into markdown files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fyodor

Convert your Amazon Kindle highlights, notes and bookmarks into markdown files.

What is Fyodor

This application parses My Clippings.txt from your Kindle and generates a markdown file for each book/document, in the format #{Author} - #{Title}.md. This way, your annotations are conveniently stored and easily managed.

For samples of the output, click here.

To read more about the motivation and what problem it tries to solve, check this blog post.

Features

  • Supports all the type of entries in your clippings file: highlights, notes, clips and bookmarks.
  • Automatic removal of empty or duplicate entries (the clippings file can get a lot of those).
  • Orders your entries by location/page on each book (the clippings file is ordered by time).
  • Easily configurable for your language, allowing you to get all features and beautiful output.
  • This software goes some length to be locale agnostic: basic parsing should work without configuration for any language. It should also work even if your clippings file has multiple locales.
  • Bookmarks are printed together and notes are formatted differently, for better visualization.
  • Output in a format that is clean and easy to edit/fiddle around: markdown.

This program is based on the clippings file generated by Kindle 2019, but should work with other models.

Limitations

We are limited by the data Kindle makes available through My Clippings.txt. This means:

  • We don't have chapter information.
  • We can’t guess all entries that were deleted.

Installation

Install Ruby and run:

$ gem install fyodor

Updating

Run:

$ gem update fyodor

Configuration

Fyodor has an optional configuration file, which is used for the following.

Languages

If your Kindle is not in English, you should tell Fyodor how some things are called by your My Clippings.txt (e.g. highlights, pages, etc). Fyodor should still work without configuration, but you won't take advantage of many features, resulting in a dirtier output.

  1. Download the sample config to ~/.config/fyodor/fyodor.toml or $XDG_CONFIG_HOME/fyodor/fyodor.toml:
$ curl https://raw.githubusercontent.com/rc2dev/fyodor/master/docs/fyodor.toml.sample --create-dirs -o ~/.config/fyodor/fyodor.toml
  1. Open both the configuration and your My Clippings.txt in your preferred editor. Change the values in the [parser] section to mirror what you get in My Clippings.txt.

For example, this is the configuration for Brazilian Portuguese:

[parser]
highlight = "Seu destaque"
note = "Sua nota"
bookmark = "Seu marcador"
clip = "Recortar este artigo"
loc = "posição"
page = "página"
time = "Adicionado:"

Showing the time

In the configuration file you can also set whether to print the time of each entry. On [output], set time to true or false.

Usage

$ fyodor CLIPPINGS_FILE [OUTPUT_DIR]

Where:

  • CLIPPINGS_FILE is the path for My Clippings.txt.
  • OUTPUT_DIR is the directory to write the markdown files. If none is supplied, this will be fyodor_output under the current directory.

PSA: HTML to markdown

Did you export your annotations to HTML using the Kindle mobile app?

You can convert it to markdown with a script I wrote specifically for it.

Buy me a coffee

If you like Fyodor, you can show your support here:

Buy Me A Coffee

License

Licensed under GPLv3

Copyright (C) 2019-2020 Rafael Cavalcanti

About

Convert your Amazon Kindle highlights and notes into markdown files.

License:GNU General Public License v3.0


Languages

Language:Ruby 100.0%