A plugin for reading and annotating PDFs and EPUBs in obsidian.
JavaScript
1,773
88 commits
updated Jan 8, 2024
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.

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
---
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.
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
To return to the regular obsidian markdown editing mode, you can select more options → Open 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)
The plugin has built-in dark mode support. To toggle dark mode, select more options → Toggle Dark Mode while annotating.
You can also tweak the dark mode behavior in the settings tab for the plugin.
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.
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.
Fix bug #208 introduced in 0.2.5 It was impossible to open an internal link because of the plugin
Internal changes
Move buttons 'Annotate', 'Toggle Dark Mode', 'Open as Markdown' to top of options menu
Video annotation
Internal changes
annotation-target-type can now take on the values web and video.
web the annotation target can (in theory) be any website. Some work better than others. Link navigation does not work.video, only youtube links are supported. In order to use this feature, a link to a zip file with the annotator.tv resources must be provided in the plugin settings. It cannot be bundled with the plugin since that would most likely violate copyright.

Custom Default Path. See this comment on #19 for more info.Post to... button always say Post to Only Me to reduce privacy confusion.file: protocol support, various url fixes, privacy improvements, minor fixesfile: protocol links added. (Has not been tested much yet.).gitignored, which prevented it from working in the previous releases. (See issue #6)src directiory so that the repo looks a bit less messy.Note: The files under the
resourcesfolder 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.
If you want to support me and my work, you can sponsor me on Github (preferred method) or donate something on Paypal.
1,583 followers · starred Mar 2024
141 followers · starred Oct 2022
22 followers · starred Jan 2022
37 followers · starred Jun 2022
A plugin for reading and annotating PDFs and EPUBs in obsidian.
JavaScript
1,773
88 commits
updated Jan 8, 2024
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.

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
---
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.
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
To return to the regular obsidian markdown editing mode, you can select more options → Open 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)
The plugin has built-in dark mode support. To toggle dark mode, select more options → Toggle Dark Mode while annotating.
You can also tweak the dark mode behavior in the settings tab for the plugin.
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.
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.
Fix bug #208 introduced in 0.2.5 It was impossible to open an internal link because of the plugin
Internal changes
Move buttons 'Annotate', 'Toggle Dark Mode', 'Open as Markdown' to top of options menu
Video annotation
Internal changes
annotation-target-type can now take on the values web and video.
web the annotation target can (in theory) be any website. Some work better than others. Link navigation does not work.video, only youtube links are supported. In order to use this feature, a link to a zip file with the annotator.tv resources must be provided in the plugin settings. It cannot be bundled with the plugin since that would most likely violate copyright.

Custom Default Path. See this comment on #19 for more info.Post to... button always say Post to Only Me to reduce privacy confusion.file: protocol support, various url fixes, privacy improvements, minor fixesfile: protocol links added. (Has not been tested much yet.).gitignored, which prevented it from working in the previous releases. (See issue #6)src directiory so that the repo looks a bit less messy.Note: The files under the
resourcesfolder 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.
If you want to support me and my work, you can sponsor me on Github (preferred method) or donate something on Paypal.
1,583 followers · starred Mar 2024
141 followers · starred Oct 2022
22 followers · starred Jan 2022
37 followers · starred Jun 2022