Skip to content

arthurrump/logseq-highlights.koplugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logseq Highlights KOReader Plugin

A KOReader plugin that exports highlights in a format compatible with Logseq's PDF highlight features.

Features

  • Integrates with KOReader's built-in highlight export system as an additional export format
  • Generates Logseq-compatible markdown files (hls__<name>.md) in the pages/ subdirectory
  • Generates Logseq-compatible EDN files (<name>.edn) in the assets/ subdirectory, with correct positioning of highlight boxes
  • Includes user annotations (notes) on highlights as child blocks in the markdown output
  • Deterministic UUIDs for highlights, so re-exporting produces consistent results
  • Configurable Logseq graph directory path
  • Configurable file path transformation for file:: and file-path:: properties

Installation

  1. Copy the logseq-highlights.koplugin directory to KOReader's plugins directory
  2. Restart KOReader

Then the plugin will be available through the Export highlights menu.

Configuration

After installation, enable the Logseq export format in KOReader:

  1. Open the Export highlights menu (in the top menu bar under the tools section)
  2. Go to Choose formats and services
  3. Open the Logseq submenu
  4. Toggle Export to Logseq to enable the format
  5. Use Set Logseq graph directory to select the root directory of your Logseq graph
  6. Optionally, configure Set path transformation to adjust how document file paths appear in the exported files

Path Transformation

The path transformation allows you to adjust the absolute file path stored in the file:: and file-path:: properties of the markdown file. This is useful when the document path on your e-reader differs from the path where the files are accessible on your computer.

For example, if your documents are at /mnt/onboard/Papers/paper.pdf on the e-reader but at /home/user/Papers/paper.pdf on your computer, you would set:

  • Find prefix: /mnt/onboard
  • Replace with: file:///home/user

Color Mapping

KOReader highlight styles are mapped to Logseq colors as follows:

KOReader Style Logseq Color
Lighten Yellow
Underscore Blue
Strikeout Red
Invert Purple

Running Tests

lua spec/logseq_spec.lua

About

A KOReader plugin that exports highlights in a format compatible with Logseq's PDF highlight features

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages