weirdNox / org-noter

Emacs document annotator, using Org-mode
GNU General Public License v3.0
1.08k stars 101 forks source link
annotate convenience documents elisp emacs interleaved notes org-mode pdf sync

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

Org-noter's purpose is to let you create notes that are kept in sync when you scroll through the document, but that are external to it - the notes themselves live in an Org-mode file. As such, this leverages the power of [[http://orgmode.org/][Org-mode]] (the notes may have outlines, latex fragments, babel, etc...) while acting like notes that are made /inside/ the document. Also, taking notes is very simple: just press @@html:kbd>@@i@@html:</kbd@@ and annotate away!

Note: While this is similar to ~interleave~, it is not intended to be a clone; therefore, /not every feature of the original mode is available/! You may prefer using the original, because this is a different take on the same idea. [[#diff][View some differences here.]]

Org-noter is compatible with [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html][DocView]], [[https://github.com/politza/pdf-tools][PDF Tools]], and [[https://github.com/wasamasa/nov.el][Nov.el]]. These modes make it possible to annotate PDF, EPUB, Microsoft Office, DVI, PS, and OpenDocument.

On a personal note, if you annotate and read lots of PDFs, give PDF Tools a try! It is great.

** Features

Many of these features are demonstrated in the screencast, so take a look if you are confused!

** Installation *** MELPA This package is [[https://melpa.org/#/org-noter][available from MELPA]], so if you want to install it and have added MELPA to your package archives, you can run @@html:kbd>@@M-x@@html:</kbd@@ ~package-install~ @@html:kbd>@@RET@@html:</kbd@@ ~org-noter~

*** Manual installation You can also install it manually, using =package.el=.

  1. Download =org-noter.el=
  2. Open it
  3. Run @@html:kbd>@@M-x@@html:</kbd@@ ~package-install-from-buffer~ @@html:kbd>@@RET@@html:</kbd@@

** Usage If you want to give it a try without much trouble:

This will open a new dedicated frame where you can use [[#keys][the keybindings described here]].

More generally, there are two modes of operation. You may run @@html:kbd>@@M-x@@html:</kbd@@ ~org-noter~:

There is, of course, more information in the docstrings of each command.

** Screencast [[https://www.youtube.com/watch?v=Un0ZRXTzufo][Watch the screencast here!]]

Note that this package has had some updates since this screencast was made, so, while the core functionality is the same, there may be some UX and feature differences.

The files used to make this screencast are shipped with the package, so you can try this package even without creating the notes.

** Customization @@html:@@ There are two kinds of customizations you may do:

  1. Global settings, affecting every session
  2. Document-specific settings, which override the global settings

The global settings are changed with either the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html#Easy-Customization][customization interface from Emacs]] or directly in your init file. To find which settings are available, you may use the customization interface or you may just read =org-noter.el=.

The best way to set document-specific settings is by using the utility commands provided (list below). In order to use them, you need an open session. The commands may change the settings for that session only (not surviving restarts), or for every session with that document.

List of utility commands (check the docstrings to learn how to make the changes permanent, or revert to the default):

** Keybindings and commands @@html:@@ :PROPERTIES: :CUSTOM_ID: keys :END: | Key | Description | Where? | | @@html:kbd>@@i@@html:</kbd@@ | Insert note | Document buffer | | @@html:kbd>@@M-i@@html:</kbd@@ | Insert precise note | Document buffer | | @@html:kbd>@@q@@html:</kbd@@ | Kill session | Document buffer | | @@html:kbd>@@M-p@@html:</kbd@@ | Sync previous page/chapter | Document and notes buffer | | @@html:kbd>@@M-.@@html:</kbd@@ | Sync current page/chapter | Document and notes buffer | | @@html:kbd>@@M-n@@html:</kbd@@ | Sync next page/chapter | Document and notes buffer | | @@html:kbd>@@C-M-p@@html:</kbd@@ | Sync previous notes | Document and notes buffer | | @@html:kbd>@@C-M-.@@html:</kbd@@ | Sync selected notes | Document and notes buffer | | @@html:kbd>@@C-M-n@@html:</kbd@@ | Sync next notes | Document and notes buffer |

You can use the usual keybindings to navigate the document (@@html:kbd>@@n@@html:</kbd@@, @@html:kbd>@@p@@html:</kbd@@, @@html:kbd>@@SPC@@html:</kbd@@, ...).

There are two types of sync commands:

When using PDF Tools, the command ~org-noter-create-skeleton~ imports the PDF outline or annotations (or both!) as notes, and it may be used, for example, as a starting point.

You may also want to check the docstrings of the functions associated with the keybindings, because there is some extra functionality in some.

** Why a rewrite from scratch? Why not contribute to the existing Interleave package? Doing a refactor on a foreign codebase takes a long time because of several factors, like introducing the ideas to the owner (with which he may even disagree), learning its internals, proposing pull requests, more back and forth in code review, etc...

Besides, I like doing things from scratch, not only because it expands my skills, but also because it is something I find very rewarding!

* Non-exhaustive list of differences from Interleave @@html:@@ :PROPERTIES: :CUSTOM_ID: diff :END: ** New features

  • Each session is isolated, which means that it has its own frame with indirect buffers
    • Makes it possible to have several sessions simultaneously open
    • Doesn't narrow the original buffer, which continues completely accessible
  • Has precise notes (attached to a section of a page)
  • Also supports nov.el
  • Skeleton extraction (outline and/or annotations)
  • Being able to use the closest previous note when no notes are present on the current page
  • Closing all notes not related to the notes present in the current view
  • Possibility of overriding some global settings in each document or session

**** Some annoyances fixed

  • Notes not sorted
  • Notes not synced when executing different page change commands, eg. goto-page or beginning-of-buffer
  • Sometimes it would start narrowing other parts of the buffer, giving errors when trying to go to notes.

*** Changes to make in order to be compatible with documents created by Interleave This package only works like the multi-pdf mode of Interleave - you can't open a session without having a parent headline.

For compatibility with existing notes made with Interleave, you can do one of two things:

  • Change the following property names inside the your documents: | Old | New | |------------------------+------------------| | =INTERLEAVE_PDF= | =NOTER_DOCUMENT= | | =INTERLEAVE_PAGE_NOTE= | =NOTER_PAGE= |

  • Set these variables on your init file:

    +BEGIN_SRC emacs-lisp

    (setq org-noter-property-doc-file "INTERLEAVE_PDF" org-noter-property-note-location "INTERLEAVE_PAGE_NOTE")

    +END_SRC

** Acknowledgments I must thank [[https://github.com/rudolfochrist][Sebastian]] for the original idea and inspiration. Also, many thanks to everyone who contributed more ideas, reported bugs and submitted PRs :)