elias-sundqvist / obsidian-annotator

A plugin for reading and annotating PDFs and EPUBs in obsidian.
GNU Affero General Public License v3.0
1.51k stars 71 forks source link
epub epub-reader obsidian obsidian-md obsidian-plugin pdf pdf-annotator pdf-viewer

GitHub release (latest SemVer) GitHub All Releases

Obsidian Annotator

This is a plugin for Obsidian (https://obsidian.md). It allows you to open and annotate PDF and EPUB files.

The plugin is based on https://web.hypothes.is/, but modified to store the annotations in a local markdown file instead of on the internet.

Demonstration

annotator demo

Warning! In the above gif I use Dataview syntax to specify the annotation-target. If you do not have the dataview plugin installed, you must instead write the annotation-target in the frontmatter, like this:

---
annotation-target: https://arxiv.org/pdf/2104.13478.pdf
---

Known issues

  1. Plugin doesn't work on iOS 16.3 or higher. Follow #289 issue state up to date.
  2. Reader doesn't show annotations if they were changed on different platforms.

Getting Started

Add the property annotation-target to the frontmatter of your obsidian note, with a value corresponding to the location of the EPUB/PDF file. The location can either be a file in the vault (such as Pdfs/mypdf.pdf), or online (such as https://arxiv.org/pdf/2104.13478.pdf)

Then you can, in the open note pane, select "more options" (the three dots in the top right), and a new option "annotate" should be available.

The plugin automatically tries to determine whether the file is an epub or pdf based on the file path, but in case this doesn't work, you can also add the property annotation-target-type and specify whether it is epub or pdf manually.

If you have dataview installed, then you can also specify the annotation target with a dataview attribute. In this case, obsidian-style links can be used instead of a plain-text path.

WARNING! Don't rename an original pdf or epub file! The plugin is going to lose the connection between annotations and file in that case.

Annotating

Annotation is self-explanatory. Select text with your mouse to get started.

In the future, it would be nice to add colored highlights and image/region highlights. These features will have to be added to hypothes.is first, however. See these relevant issues: https://github.com/hypothesis/product-backlog/issues/198, https://github.com/hypothesis/product-backlog/issues/669

The annotations in markdown

To return to the regular obsidian markdown editing mode, you can select more optionsOpen as MD. Each annotation has an associated quote block with a block reference. Be careful with modifying these blocks. Minor edits to PREFIX, HIGHLIGHT, and POSTFIX are typically ok. But if the edits are too major, hypothesis may no longer be able to identify the corresponding text.

The COMMENT region can be freely edited. (but ensure that it is still part of the quote block.)

The TAGS region should consist of a comma-separated list of obsidian tags. (like #tag1, #tag2, #tag3)

Dark Mode

The plugin has built-in dark mode support. To toggle dark mode, select more optionsToggle Dark Mode while annotating. You can also tweak the dark mode behavior in the settings tab for the plugin.

Linking to annotations

An obsidian link to an annotation block-reference will, when clicked, open the corresponding file and scroll to the associated highlight. If the file is already open in a pane, then the link will cause the existing pane to scroll instead.

Contributing

Visit CONTRIBUTING.md for information on building from source or contribution improvements. To report a bug, ask a question or suggest an improvement for this plugin, you can create an issue.

Changelog

0.2.11 (2024-01-06)

0.2.10 (2023-01-09)

0.2.9 (2023-01-05)

0.2.8 (2022-11-27)

0.2.7 (2022-10-31)

0.2.6 (2022-08-19)

0.2.5 (2022-08-14)

0.2.4 (2022-07-23)

0.2.2 (2022-05-14) Minor improvement

0.2.1 (2022-03-06) BRAT release Basic web and video annotation

0.2.0 (2022-01-26) BRAT release Improved markdown rendering, epub reader

0.1.9 (2022-01-17) Minor fix

0.1.8 (2022-01-16) Minor fixes, added default annotation mode setting

0.1.7 (2022-01-14) BRAT release chinese file name support

0.1.6 (2022-01-12) BRAT release Live Preview Drag and Drop fix + chinese character support

0.1.5 (2021-12-19) Quick fix

0.1.4 (2021-12-18) Fix Issue With Ipad + Windows/Android compatibility.

0.1.3 (2021-09-12) Basic CORS support for desktop

0.1.2 (2021-09-11) Quick Fix

0.1.1 (2021-09-10) Drag & Drop Fixes, Open links in new pane, Multi-Line Comments Fix

0.1.0 (2021-09-03) Added annotation highlight drag and drop

0.0.9 (2021-09-03) Quick fix for annotation id bug

0.0.8 (2021-09-03) Added Pre/Postfix setting toggles, Fixed scrolling issue, More size reductions.

0.0.7 (2021-09-01) Added Custom Default Path setting, Page notes fix, Slight JSON size reduction, etc.

0.0.6 (2021-08-30) file: protocol support, various url fixes, privacy improvements, minor fixes

0.0.5 (2021-08-26) Fixed EPUB bug, minor file restructuring

0.0.4 (2021-08-26) Chinese File name support

0.0.3 (2021-08-26) Plugin Size Reduction

0.0.2 (2021-08-26) Minor fixes

0.0.1 (2021-08-25) First Release

License

Note: The files under the resources folder are scraped from the web. Each website has its licence file attached in the associated folder.

Obsidian Annotator is licensed under the GNU AGPLv3 license. Refer to LICENSE for more information.

Support

If you want to support me and my work, you can sponsor me on Github (preferred method) or donate something on Paypal.