dalanicolai / djvu3

Extend djvu.el to display annotations and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

djvu3

This file extends djvu.el (and svg.el) with annotation rendering features and a fast occur search feature. The annotation drawing feature is implemented using svg.el. It is a newer alternative to djvu2.el, which uses the external imagemagick command for rendering annotations.

The ultimate goal of this package is to get it merged into djvu.el. However, the code in both djvu.el and in this package could use some refactoring. Also, the annotation features and interface can be easily extended and made more user-friendly. Any feedback or suggestions how to organize/design the interface are very welcome.

djvu.el already provides extensive annotation editing features, but without rendering features for which it recommends users to use an external application (e.g. djview).

The main features that this package implements are:

  • annotation rendering features using svg.el and clickable links
  • a marker extension to svg.el for providing arrowheads (or other types of markers)
  • fast occur search function, similar to that of the pdf-tools package.
  • a quite fancy keyboard annotation function (djvu-keyboard-annot)
  • an imenu index function to enable imenu navigation
  • document restore function to open the document at the last location of the previous session
  • transient for quickly adding metadata (djvu-edit-metadata)

Installation

Simply load the file djvu3.el after djvu.el (djvu3.el will load djvu.el automatically if it is found in the load path)

Usage

Instructions for usage are found in the preliminary comments in the djvu.el file itself. Keybindings (e.g. for annotations) can be looked up by typing M-x describe-keymap RET djvu-image-mode-map. Additionally C-h m shows mode keybindings is active (i.e. when visiting a djvu-file).

In particular, the package provides the following interactive functions (called via M-x):

  • djvu-occur
  • djvu-keyboard-annot

and support for:

  • imenu
  • djvu-edit-metadata

Spacemacs

This package can very easily be installed via the djvu-layer.

Comments

  • text annotations: The font ratio in SVG is fixed. Therefore, the text size is determined by fitting the complete comment either horizontally or vertically inside the annotation area.

Keybindings

Key BindingDescription
SPC m hkeyboard highlight
mouse-1-draghighlight
S-mouse-1-dragtext annotation (comment)
C-mouse-1-dragtext pushpin (rendering pushpin not, yet, implemented)
mouse-2-dragline
S-mouse-2-draghorizontal line
C-mouse-2-dragvertical line
C-S-mouse-2-dragarrow

About

Extend djvu.el to display annotations and more


Languages

Language:Emacs Lisp 100.0%