lepisma / Org Books
Projects that are alternatives of or similar to Org Books
#+TITLE: org-books #+AUTHOR: Abhinav Tushar
[[https://travis-ci.org/lepisma/org-books][https://img.shields.io/travis/lepisma/org-books/master.svg]] [[https://melpa.org/#/org-books][file:https://melpa.org/packages/org-books-badge.svg]] [[https://stable.melpa.org/#/org-books][file:https://stable.melpa.org/packages/org-books-badge.svg]]
Reading list management using org-mode. A sample list lives on my wiki [[https://lepisma.xyz/wiki/readings/reading-list][here]].
[[file:./screen.gif]]
** Quickstart
org-books is available on melpa.
#+BEGIN_SRC emacs-lisp ;; 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'. #+END_SRC
-
To add books manually, use
org-books-add-bookfunction. To add from urls, callorg-books-add-url(or useorg-books-cliplinkif url is in clipboard). -
To give ratings, go to the entry and call
org-books-rate-book. -
While filing a book,
org-books-file-depthtells which headings are to be considered as a category (like fiction or something). -
org-books-add-to-top(defaultt) 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:
#+BEGIN_SRC emacs-lisp :exports both :results output (print (org-books-get-details-amazon "https://www.amazon.in/Algebra-Chapter-Graduate-Studies-Mathematics/dp/0821847813/")) #+END_SRC
#+RESULTS: : ("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
#+BEGIN_SRC emacs-lisp (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))) #+END_SRC
*** Using url from clipboard
#+BEGIN_SRC emacs-lisp (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)))"))) #+END_SRC