No description
  • Emacs Lisp 100%
Find a file
Abhinav Tushar 3f769e5a5a
v0.3.1
2025-10-22 15:50:42 +05:30
test Update goodreads selector 2025-06-30 17:45:10 +05:30
.gitignore Update goodreads selector 2025-06-30 17:45:10 +05:30
.travis.yml Test only on 25.3 2018-03-29 20:15:07 -04:00
Cask Allowing filing books under headers 2018-05-09 01:23:45 -04:00
LICENSE Initial commit 2017-06-20 13:16:49 -04:00
org-books.el v0.3.1 2025-10-22 15:50:42 +05:30
README.org add support for logging reading notes 2021-04-09 00:43:37 +05:30
screen.gif gif instead of webm 2018-05-09 02:12:42 -04:00

org-books

https://img.shields.io/travis/lepisma/org-books/master.svg

Reading list management using org-mode. A sample list lives on my wiki here.

/fz0x1/org-books/media/branch/master/screen.gif

Quickstart

org-books is available on melpa.

;; Set path to the reading list org file
(setq org-books-file "~/my-list.org")

;; A basic template file can be generated using the function `org-books-create-file'.
  • To add books manually, use org-books-add-book function. To add from urls, call org-books-add-url (or use org-books-cliplink if url is in clipboard).
  • To give ratings, go to the entry and call org-books-rate-book.
  • While filing a book, org-books-file-depth tells which headings are to be considered as a category (like fiction or something).
  • org-books-add-to-top (default t) tells whether to add the book at the top or bottom under the selected heading.

Adding new source

A source for books provide a details function that takes certain input (like a url in case of amazon) and returns a list of title, author and props. props is an alist which gets added to the entry as org properties. Here is the output from amazon's:

(print (org-books-get-details-amazon "https://www.amazon.in/Algebra-Chapter-Graduate-Studies-Mathematics/dp/0821847813/"))
("Algebra: Chapter 0 (Graduate Studies in Mathematics)" "Paolo Aluffi" (("AMAZON" . "https://www.amazon.in/Algebra-Chapter-Graduate-Studies-Mathematics/dp/0821847813/")))

With the details function defined, you need to write the url pattern it accepts and add it to the variable org-books-url-pattern-dispatches. Check variable's docstring for more details.

As of now there are the following sources:

  • Manual (input: title, author etc.)
  • Amazon (input: url)
  • Goodreads (input: url)
  • Openlibrary (input: url)
  • ISBN (input: ISBN, dispatches openlibrary url source)

Using org-capture

For a more flexible setup, you might just want to use org-capture, possibly with a little help from functions present in this package. Directly using capture gives you much more flexibility over the structure and organization of entries. Here we describe a few capture templates that can be used:

Manual entry

  (setq org-capture-templates
        '(("b" "Book" entry (file "some-file.org")
           "* %^{TITLE}\n:PROPERTIES:\n:ADDED: %<[%Y-%02m-%02d]>\n:END:%^{AUTHOR}p\n%?" :empty-lines 1)))

Using url from clipboard

  (setq org-capture-templates
        '(("b" "Book" entry (file "some-file.org")
           "%(let* ((url (substring-no-properties (current-kill 0)))
                    (details (org-books-get-details url)))
               (when details (apply #'org-books-format 1 details)))")))

Capturing reading logs

While reading, I keep a timestamped log under the book connected via org capture template. Here is how it looks like:

    *** READING Book name
    :PROPERTIES:
    :AUTHOR:   Author
    :ADDED:    [2020-03-29]
    :AMAZON:   https://www.amazon.com/...
    :END:

    **** Log
     + [2021-04-09 Fri 00:32] ...
     + [2021-04-08 Thu 23:59] This book is very ...

Org capture template looks like the following, using the function org-books-visit-book-log from this package:

  (setq org-capture-templates
        '(("b" "Book log" item (function org-books-visit-book-log)
             "- %U %?" :prepend t)))