Yet another calibre client for emacs.
This package integrates calibre (using calibredb) into emacs.
- Powerful ebook dashboard.
- Manage ebooks, actually not only ebooks!
- Fetch metadata from online sources incl. automatic detection of ISBN for pdf and djvu files (automatic detection of ISBN requires pdf-tools and djvu package for pdf and djvu files respectively)
- Manage Ebooks’ libraries and virtual libraries.
- Customized Metadata: Tag, comment, highlight, favorite, archive etc.
- Quick search, filter, make actions on items with ivy and helm.
- Org-ref support.
- toc-mode (easily manage pdf/djvu document’s Table Of Contents)
- centaur-tabs/awesome-tab (Enable tab in emacs, turn eamcs into a modern multiple tabs pdf/epub reader.)
calibredb will use the built-in SQLite engine if it is available (for emacs >29). For older emacs or emacs that is not built with SQLite support, you should install the external sqlite3 program.
brew install sqlite
With chocolatey
choco install sqlite
For example, in Ubuntu 18.04:
sudo apt install sqlite3
Download calibre’s DMG file from https://calibre-ebook.com/download_osx, install calibre.app to /Applications
With chocolatey
choco install calibre
For example, in Ubuntu 18.04:
sudo apt install calibre
It’s available on Melpa :
M-x package-install calibredb
For Spacemacs this calibre-layer implements calibre.el with evilified keybindings
(require 'calibredb)
(setq calibredb-root-dir "~/OneDrive/Doc/Calibre")
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/OneDrive/Doc/Calibre")
("/Users/damonchan/Documents/Books Library")
("/Users/damonchan/Documents/HELLO")
("/Users/damonchan/Documents/Books")
("/Users/damonchan/Documents/World")))
PS: If sqlite3
and calibredb
is in not in your system path, set them with
(setq sql-sqlite-program "/usr/bin/sqlite3") ;; for emacs < 29 or no sqlite built-in emacs
(setq calibredb-program "/Applications/calibre.app/Contents/MacOS/calibredb")
(use-package calibredb
:defer t
:config
(setq calibredb-root-dir "~/OneDrive/Org/Doc/Calibre")
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/OneDrive/Org/Doc/Calibre")
("~/Documents/Books Library")
("~/Documents/LIB1")
("/Volumes/ShareDrive/Documents/Library/"))))
The maximum number of entries to display in a single page:
(setq calibredb-search-page-max-rows 44)
Virtual libraries are some convenient shortcuts for quick filtering the Ebooks
by setting the calibredb-search-filter
.
(setq calibredb-virtual-library-alist '(("1. Development - work" . "work pdf")
("2. Read it later" . "Readit epub")
("3. Development - rust" . "rust")))
You can configure the column width:
For example:
(setq calibredb-id-width 4)
- Set positive to limit the width.
- Set 0 to hide.
- Set -1 to keep original length.
The following columns are supported:
calibredb-id-width
calibredb-format-width
calibredb-tag-width
calibredb-title-width
calibredb-author-width
calibredb-comment-width
calibredb-date-width
Then in *calibredb-search*
buffer, press r
to refresh the library.
Enable size indicator:
(setq calibredb-size-show t)
Then in *calibredb-search*
buffer, press r
to refresh the library.
You can choose all-the-icons, icons-in-terminal, unicode icons to render the icons. You have to install the icons packages by yourself, otherwise it would not work.
To enable all-the-icons:
(setq calibredb-format-all-the-icons t)
To enable icons-in-terminal:
(setq calibredb-format-icons-in-terminal t)
To use unicode icons,
(setq calibredb-format-character-icons t)
Then in *calibredb-search*
buffer, press r
to refresh the library.
Notice: Do not enable icons on big libraries, it will consume a lot of time than you imagine.
TODO: Auto disable format icons when dealing with big libraries.
You can output a BibTex file which can be used in org-ref.
(require 'org-ref)
(setq calibredb-ref-default-bibliography (concat (file-name-as-directory calibredb-root-dir) "catalog.bib"))
(add-to-list 'org-ref-default-bibliography calibredb-ref-default-bibliography)
(setq org-ref-get-pdf-filename-function 'org-ref-get-mendeley-filename)