Node app to parses the kindle file that stores all the highlights you do in the books you read (My Clippings.txt) and creates a Markdown file per book grouping the quotes. It is intended to be used with Jekyll. It links to the book cover image too. Example of the output
The quotes are ordered by date descending. The books have the date of the most recent quote assigned.
- Install Node I you haven't
- Clone and move to folder
npm i
node app "some\path\My Clippings.txt" "output\path"
It works also with only the first argument using output
as default output folder.
It works also with no parameters but expects to find the My Clippings.txt
in the project folder.
- Create a _books folder in your jekyll repo and move there all the generated md files.
- Add the collection to your
_config.yml
:
include:
- _books
...
collections:
books:
output: true
permalink: /:collection/:path/
...
defaults:
...
# _books
- scope:
path: ""
type: books
values:
layout: single
author_profile: true
share: true
comments: true
- Add a navigation link in the top bar editing
navigation.yml
inside_data
folder:
main:
- title: cv
url: /cv/
- title: books
url: /books/
- Finally create a page that will have the links to all the books. I created
books.md
and put it inside_pages
folder:
---
title: Books
layout: collection
permalink: /books/
collection: books
entries_layout: grid
classes: wide
sort_order: reverse
---
In case you want another type of output, there is a middle step (parse) were a simple array of objects (books) is created with the following structure:
[
{
title: 'Scrum And Xp From The Trenches',
date: '2015-02-21',
author: 'Henrik Kniberg',
quotes: [
{
date: '2015-02-21',
quote: 'Pair programming does improve code quality....'
},
{
date: '2015-02-19',
quote: 'anotherquote....'
}
]
},
{
title: 'Another book title',
date: '2014-04-21',
author: 'Fancy Name',
quotes: [
{
date: '2017-02-21',
quote: 'interensting quote....'
},
{
date: '2019-02-19',
quote: 'even more interesting quote....'
}
]
}
]