Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chenyanming/calibredb.el

Emacs calibre client - An Ebook Management Solution in Emacs.
https://github.com/chenyanming/calibredb.el

Last synced: 3 months ago
JSON representation

Emacs calibre client - An Ebook Management Solution in Emacs.

Awesome Lists containing this project

README

        

#+TITLE: [[https://github.com/chenyanming/calibredb.el][calibredb.el]]
#+AUTHOR: Damon Chan
#+DATE: Aug 9, 2020
#+SINCE:
#+STARTUP: inlineimages nofold
#+EXPORT_FILE_NAME: index.html
#+HTML_HEAD:
#+HTML_HEAD:

#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:
#+HTML_HEAD:

[[https://melpa.org/#/calibredb][file:https://melpa.org/packages/calibredb-badge.svg]]

* Table of Contents :TOC_1:noexport:
- [[#description][Description]]
- [[#installation][Installation]]
- [[#configuration][Configuration]]
- [[#workflow][Workflow]]
- [[#qa][Q&A]]
- [[#features][Features]]
- [[#releases][RELEASES]]
- [[#contributor][Contributor]]

* Description
Yet another [[https://calibre-ebook.com/][calibre]] client for emacs.

#+attr_org: :width 600px
[[file: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
#+BEGIN_SRC sh
brew install sqlite
#+END_SRC

*** Windows
With chocolatey
#+BEGIN_SRC sh
choco install sqlite
#+END_SRC

*** Linux
For example, in Ubuntu 18.04:
#+BEGIN_SRC sh
sudo apt install sqlite3
#+END_SRC

** Install calibre
*** macOS
Download calibre's DMG file from https://calibre-ebook.com/download_osx, install calibre.app to /Applications

*** Windows
With chocolatey
#+BEGIN_SRC sh
choco install calibre
#+END_SRC

*** Linux
For example, in Ubuntu 18.04:
#+BEGIN_SRC sh
sudo apt install calibre
#+END_SRC

** Install calibredb.el
It's available on [[https://melpa.org/][Melpa]] :

#+BEGIN_SRC emacs-lisp
M-x package-install calibredb
#+END_SRC

** Spacemacs Layer

For Spacemacs [[https://github.com/dalanicolai/calibre-layer][this calibre-layer]] implements calibre.el with evilified keybindings

* Configuration

** Quick Start
*** require
#+BEGIN_SRC emacs-lisp
(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")))
#+END_SRC

PS: If ~sqlite3~ and ~calibredb~ is in not in your system path, set them with

#+BEGIN_SRC emacs-lisp
(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")
#+END_SRC

*** use-package

#+BEGIN_SRC emacs-lisp
(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/"))))
#+END_SRC

** Page
The maximum number of entries to display in a single page:
#+begin_src emacs-lisp
(setq calibredb-search-page-max-rows 44)
#+end_src

** Virtual Libraries
Virtual libraries are some convenient shortcuts for quick filtering the Ebooks
by setting the ~calibredb-search-filter~.

#+BEGIN_SRC emacs-lisp
(setq calibredb-virtual-library-alist '(("1. Development - work" . "work pdf")
("2. Read it later" . "Readit epub")
("3. Development - rust" . "rust")))
#+END_SRC

** Column width
You can configure the column width:

For example:
#+BEGIN_SRC emacs-lisp
(setq calibredb-id-width 4)
#+END_SRC

- 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:
#+BEGIN_SRC emacs-lisp
(setq calibredb-size-show t)
#+END_SRC

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

** File format icons
You can choose [[https://github.com/domtronn/all-the-icons.el][all-the-icons]], [[https://github.com/seagle0128/icons-in-terminal.el][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:
#+BEGIN_SRC emacs-lisp
(setq calibredb-format-all-the-icons t)
#+END_SRC

To enable icons-in-terminal:
#+BEGIN_SRC emacs-lisp
(setq calibredb-format-icons-in-terminal t)
#+END_SRC

To use unicode icons,
#+BEGIN_SRC emacs-lisp
(setq calibredb-format-character-icons t)
#+END_SRC

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.
#+BEGIN_SRC emacs-lisp
(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)
#+END_SRC
* [[file:WORKFLOW.org][Workflow]]
* [[file:Q&A.org][Q&A]]
* [[file:FEATURES.org][Features]]
* [[file:RELEASES.org][RELEASES]]

* Contributor
#+html: