A KOReader plugin that exports highlights in a format compatible with Logseq's PDF highlight features.
- Integrates with KOReader's built-in highlight export system as an additional export format
- Generates Logseq-compatible markdown files (
hls__<name>.md) in thepages/subdirectory - Generates Logseq-compatible EDN files (
<name>.edn) in theassets/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::andfile-path::properties
- Copy the
logseq-highlights.koplugindirectory to KOReader'spluginsdirectory - Restart KOReader
Then the plugin will be available through the Export highlights menu.
After installation, enable the Logseq export format in KOReader:
- Open the Export highlights menu (in the top menu bar under the tools section)
- Go to Choose formats and services
- Open the Logseq submenu
- Toggle Export to Logseq to enable the format
- Use Set Logseq graph directory to select the root directory of your Logseq graph
- Optionally, configure Set path transformation to adjust how document file paths appear in the exported files
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
KOReader highlight styles are mapped to Logseq colors as follows:
| KOReader Style | Logseq Color |
|---|---|
| Lighten | Yellow |
| Underscore | Blue |
| Strikeout | Red |
| Invert | Purple |
lua spec/logseq_spec.lua