Skip to content

AdolDev40/obsidian-epub-plugin

 
 

Repository files navigation

Obsidian ePub Reader Plugin

An ePub reader plugin for Obsidian with a PDF++ style interface, multi-color highlighting, note annotations, and deep-link navigation.

Features

Reading

  • ePub rendering - Open any .epub file directly inside Obsidian.
  • Paginated or scrolled view - Toggle seamless scrolling in settings.
  • Zoom - Increase/decrease font size from the toolbar.
  • Table of contents - Collapsible sidebar with chapter tree navigation.
  • Dark / light theme - Automatically matches your Obsidian theme.
  • Responsive layout - Adapts to tab stacking, pane splits, sidebar toggles, and DevTools panels.
  • Keyboard navigation - Arrow keys navigate pages only when the ePub tab is active.

Highlighting

  • 4 highlight colors - Yellow, Red, Orange, Blue - selectable from the toolbar color palette.
  • Two modes:
    • Auto-highlight OFF (default) - Select text freely to copy it.
    • Auto-highlight ON - Selected text is highlighted automatically when you release the mouse/touch.
  • Highlight popup - Click any highlight to see a popup with:
    • Preview text, date, and note.
    • Copy - Copies the text + an obsidian:// deep link.
    • Edit note - Open a note modal to annotate the highlight.
    • Delete - Remove the highlight.
  • Per-chapter re-application - Highlights persist across page turns and are re-applied on each section change.
  • Highlights panel - Side panel listing all highlights with Go to, Note, and Delete actions.

Export and Copy

  • Export to note - Generates a Markdown note from a configurable template. Uses %%EPUB-HIGHLIGHTS-START%% / %%EPUB-HIGHLIGHTS-END%% markers so re-exporting only updates the highlights section, preserving anything you write outside those markers.
  • Copy all highlights - Copies all highlights formatted using your export template to the clipboard.
  • Customizable template - Available variables:
Variable Description
{{bookTitle}} Book file name (without extension)
{{bookAuthor}} Book author (if available)
{{exportDate}} Export date (YYYY-MM-DD)
{{exportTime}} Export time (HH:MM)
{{highlightCount}} Total number of highlights
{{#each highlights}} Loop over highlights
{{highlight.text}} Highlighted text
{{highlight.color}} Color name (yellow, red, orange, blue)
{{highlight.note}} User note (empty string if none)
{{highlight.chapter}} Chapter title
{{highlight.date}} Creation date (localized)
{{highlight.cfi}} EPUB CFI range
{{highlight.uri}} obsidian:// deep link to the highlight
{{#if highlight.note}} Conditional block (renders only if note exists)

Default template

{{#each highlights}}
> [!quote-{{highlight.color}}] {{highlight.chapter}}
> {{highlight.text}}
{{#if highlight.note}}
> **Note:** {{highlight.note}}
{{/if}}
> *{{highlight.date}}* - [enlace]({{highlight.uri}})

{{/each}}

Deep Links (URI Scheme)

The plugin registers the epub-highlight protocol handler. Links follow this format:

obsidian://epub-highlight?vault=VAULT_NAME&file=FILE_PATH&cfi=CFI_RANGE
  • Clicking a link opens the ePub file and navigates to the exact highlight location.
  • If the file is already open, it focuses the existing tab.
  • Links are automatically included when copying highlights and in the export template via {{highlight.uri}}.

Callout Colors

The plugin registers custom Obsidian callout types so exported highlights render with the correct colors:

Callout Color
[!quote-yellow] Yellow (rgb 255, 212, 0)
[!quote-red] Red (rgb 255, 107, 107)
[!quote-orange] Orange (rgb 244, 132, 95)
[!quote-blue] Blue (rgb 126, 200, 227)

How to Use

1. Put books into any vault folder

Place your .epub files anywhere in your vault.

2. Click the book to open it

Click any .epub file in the file explorer to open the reader view.

3. Toolbar

From left to right:

  • Sidebar - Toggle table of contents
  • Zoom out / Zoom in - Adjust font size
  • Page navigation - Previous / Next page (also arrow keys)
  • Color palette - Select highlight color
  • Highlighter toggle - Enable/disable auto-highlight on selection
  • Highlights panel - View all highlights
  • Export - Export highlights to a Markdown note
  • Copy - Copy all highlights to clipboard (using template)

Settings

Setting Description
Scrolled View Enable seamless scrolling between pages
Same Folder Create note files in the same folder as the ePub
Note Folder Default folder for notes (when Same Folder is off)
Tags Tags added to new note metadata
Export file name Pattern for exported note name ({{bookTitle}} variable)
Export folder Folder for exported highlights (empty = same as ePub)
Template Markdown template for export (see variables above)
Reset template Restore the default export template

Installation

From Obsidian Community Plugins

  1. Open Settings - Community Plugins - Browse
  2. Search for ePub Reader
  3. Click Install, then Enable

Manual Installation

Copy main.js, styles.css, and manifest.json to:

VaultFolder/.obsidian/plugins/obsidian-epub-plugin/

License

MIT

About

An ePub reader plugin for Obsidian.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 81.3%
  • CSS 16.1%
  • JavaScript 2.6%