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 sqliteWith chocolatey
choco install sqliteFor example, in Ubuntu 18.04:
sudo apt install sqlite3Download calibre’s DMG file from https://calibre-ebook.com/download_osx, install calibre.app to /Applications
With chocolatey
choco install calibreFor example, in Ubuntu 18.04:
sudo apt install calibreIt’s available on Melpa :
M-x package-install calibredbFor Spacemacs this calibre-layer implements calibre.el with evilified keybindings
(require 'calibredb)
(setq calibredb-root-dir "~/OneDrive/Doc/Calibre")
;; for folder driver metadata: it should be .metadata.calibre
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/OneDrive/Org/Doc/Calibre" (name . "Calibre")) ;; with name
("/Users/damonchan/Documents/Books Library") ;; no name
("/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")
;; for folder driver metadata: it should be .metadata.calibre
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
(setq calibredb-library-alist '(("~/OneDrive/Org/Doc/Calibre" (name . "Calibre")) ;; with name
("~/Documents/Books Library") ;; no name
("~/Documents/LIB1")
("/Volumes/ShareDrive/Documents/Library/"))))calibredb supports download ebooks from OPDS server
(push '("http://arxiv.maplepop.com/catalog/" (name . "arxiv")) calibredb-library-alist)
(push '("https://m.gutenberg.org/ebooks.opds/" (name . "Gutenberg")) calibredb-library-alist)
(push '("http://aozora.textlive.net/catalog.opds" (name . "青空文库")) calibredb-library-alist)
(push '("https://opds.wol.moe/zh_CN" (name . "轻小说")) calibredb-library-alist)
(push '("http://192.168.1.192:54995/opds" (name . "calibre-web") (account . "account") (password . "password")) calibredb-library-alist)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-widthcalibredb-format-widthcalibredb-tag-widthcalibredb-title-widthcalibredb-author-widthcalibredb-comment-widthcalibredb-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 nerd-icons, 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 nerd-icons:
(setq calibredb-format-nerd-icons t)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)