I miss good Linux software for keeping a catalog of ebooks and for reading ebooks. It's strange that such software hasn't yet been written. Or has it? There are some general cataloging applications, like Alexandria and Tellico. They miss some necessary features, though. Anyway, I would prefer an Emacs-based ebook reader to any other GUI or console tool. Almost all parts of such book-reading software are already written: Org-mode for the catalogue, standard bookmarks to remember positions, view-mode for comfortable scrolling, etc. Why not put them all together?
This part is less important for me, because I prefer my Hanlin Ereader v3 to reading from LCD screen.
Currently, it's just a tiny hack. Bread-mode doesn't support footnotes, hyperlinks, images and text formatting.
Bread-mode turns on sgml-mode, calls sgml-tags-invible
to hide all
tags, enables longlines-mode for better readability and switches to
view-mode. The result is more or less acceptable for most
Fictionbook2 files
Bookmarks are standard Emacs bookmarks. Current positions may be
memorized with session.el
, for example.
Bread-library keeps a list of ebooks on your hard disk and provides a way to sort, search, categorize, rate and annotate them.
The first idea was to clone the Emms-browser. I began copying and pasting, but then I found what seems to be a better alternative.
For more than 1 year I used to keep my reading journal in Emacs Org-mode. I have developed a file structure that I find very useful.
autobiographical
, fiction
, nonfiction
,
modernclassics
, crypto
, math
, science
, scifi
,
philosophy
, history
, geography
, politics
, fairytale
,
kids
.
I wanted to keep this setup in Bread mode. It meant that the book manager should use Org-mode. However, processing information stored in a weakly formalized text may be a non-trivial task. Of course, the most straight-forward way to solve the task would be to use sexps as back-end for the information storage and processing. Sexps could be easily manipulated to sort and group the books in whatever way we want.
Sexps are not the most efficient storage speedwise, but I wanted to see how many books may be stored in such sexp-database before efficiency problems make me re-write Bread-library with hashes. Now, I know that Bread-library copes, at least, with 400 books. I've got a feeling, though, that the reply will slow down noticeably with 600-800 books.
After installation, Bread-library is launched with
bread-library-browse
command. It loads the data from
~/.bread-library
file and renders its contents into
Org-mode. Bread-library defines a minor mode,
bread-library-mode
, which provides the following additional
keybindings:
C-x g g
: group books by genre and by author;
C-x g a
: group books by author (the default view);
C-x g t
: sort books by title;
C-x x
: quit Bread library, saving the database.
The rendered Org file is an (almost) fully functional Org
file. Clicking on the hyperlink will open the file. You can use
S-Left
and S-Right
to switch states of the books, or use S-Up
and S-Down
to set rating. You can set and modify tags with C-c C-c
. C-c \
will search by tags. You can edit the entries and the
changes will be saved. The only trick is that the name of the
author, the title, genre and file path are stored in the properties
of the entry, not in its header. The changes made in the header and
in the hyperlink will not be saved.
You can even add new entries in this buffer, as long as you stick to the format of the entries. However, a more comfortable way to add books to the catalog is using a tiny function from Dired (see below, under Installation. When a book is added through Dired, Bread-library attempts to extract metadata from the file. Currently, Bread-library can do it for Fictionbook2 files only (and imperfectly).
(eval-after-load "dired" '(define-key dired-mode-map "\C-xl" 'dired-bread-add-book)) (defun dired-bread-add-book () (interactive) (bread-library-add-book (dired-get-filename))) (autoload 'bread-mode "bread" "Fictionbook2 mode" t) (add-to-list 'auto-mode-alist '("\\.fb2$" . bread-mode))
Date: 2008/05/04 07:51:25 AM