Skip to content

Emacs calibre client - An Ebook Management Solution in Emacs.

License

Notifications You must be signed in to change notification settings

chenyanming/calibredb.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://melpa.org/packages/calibredb-badge.svg

Table of Contents

Description

Yet another calibre client for emacs.

img/dashboard.jpg

This package integrates calibre (using calibredb) into emacs.

  1. Powerful ebook dashboard.
  2. Manage ebooks, actually not only ebooks!
  3. 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)
  4. Manage Ebooks’ libraries and virtual libraries.
  5. Customized Metadata: Tag, comment, highlight, favorite, archive etc.
  6. Quick search, filter, make actions on items with ivy and helm.
  7. Org-ref support.

Related package

  • 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.)

Installation

Install sqlite

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.

macOS

brew install sqlite

Windows

With chocolatey

choco install sqlite

Linux

For example, in Ubuntu 18.04:

sudo apt install sqlite3

Install calibre

macOS

Download calibre’s DMG file from https://calibre-ebook.com/download_osx, install calibre.app to /Applications

Windows

With chocolatey

choco install calibre

Linux

For example, in Ubuntu 18.04:

sudo apt install calibre

Install calibredb.el

It’s available on Melpa :

M-x package-install calibredb

Spacemacs Layer

For Spacemacs this calibre-layer implements calibre.el with evilified keybindings

Configuration

Quick Start

require

(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

(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/"))))

Page

The maximum number of entries to display in a single page:

(setq calibredb-search-page-max-rows 44)

Virtual Libraries

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")))

Column width

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.

Size indicator

Enable size indicator:

(setq calibredb-size-show t)

Then in *calibredb-search* buffer, press r to refresh the library.

File format icons

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.

Configure to support org-ref

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)

Contributor

About

Emacs calibre client - An Ebook Management Solution in Emacs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published