Plugin for Emacs to read FictionBook2 ebooks.
Features:
- read .fb2 and .fb2.zip files
- reach book formatting
- showing current title in header line
- internal links (select from keyboard, jump back and forth)
- navigation (next/previous chapters, imenu support)
- restoring last read position
- displaying raw xml
- book info screen
- table of content in separate buffer
Coming soon:
- integration with https://github.com/jumper047/librera-sync
- rendering book in org-mode
Main window
Header line
Metadata screen
Book loading screen
Outline
Add to your config and open any .fb2 or .fb2.zip document.
(use-package fb2-reader
:mode ("\\.fb2\\(\\.zip\\)?\\'" . fb2-reader-mode)
:commands (fb2-reader-continue)
:custom
;; This mode renders book with fixed width, adjust to your preferences.
(fb2-reader-page-width 120)
(fb2-reader-image-max-width 400)
(fb2-reader-image-max-height 400))
Install fb2-reader
from MELPA and add that string to your config:
(require 'fb2-reader)
Also you can set it up with use-package:
(use-package fb2-reader
:commands (fb2-reader-continue))
Every book rendered as buffer with certain width, so you may want to tune variables related to your monitor’s size or reading preferences:
- fb2-reader-page-width - width of rendered book
- fb2-reader-image-max-width and fb2-reader-image-max-height - max. width and height of an images in book.
You can view all available options with M-x customize-group fb2-reader
.
Just open an .fb2 or .fb2.zip file.
First opening will take a time - book will be rendered and saved to cache, so all next ones will be quick.
You can continue reading by executing M-x fb2-reader-continue
.
Key bindings listed below:
Fb2-reader:
Key | Action |
---|---|
[ , ] | Jump to previous or next chapter |
p , n | Jump to previous or next displayed link |
l , B | Jump to last used link’s location |
B , N | Jump to last used link’s target |
g | Reload current book |
v | View current book as xml |
x | Reopen fb2.zip document as archive |
i | View FB2 metadata |
j | Jump to chapter via imenu |
o , t | Show TOC outline |
c | Toggle no-cursor mode |
Metadata:
Key | Action |
---|---|
p , n | Jump to previous or next field |
P , N | Jumps to previous or next category |
c | Toggle no-cursor mode |
q | Quit window |
Outline:
Key | Action |
---|---|
p , n | Jump to previous or next heading |
RET | Follow link |
C-o , SPACE | Display link (withoiut switching to fb2 buffer) |
M-RET | Follow link and quit TOC window |
o , t | Switch to fb2 window |
q | Quit TOC window |
Q | Kill TOC window |
Heavily inspired by @spline1986’s fb2-mode. Also kudos for @vlichevsky - his testing is extremely helpful!