Skip to content

Commit

Permalink
feat: keep existing highlights and notes, and add sort by chapter pro…
Browse files Browse the repository at this point in the history
…gress (#107)

* Fix typo

* Fix typo

* Add support for keeping existing content

* Add test for import with existing files

* Some cleanup work

* Add sort highlight by chapter progress

* chore: fix failing tests

* feat: add inner block that contains the extracted higlight.

This allowes to add notes to the highlight, without overwriting the
notes and keeping the higlight up to date.

* chore: update readme

---------

Co-authored-by: Kevin Hellemun <[email protected]>
  • Loading branch information
rsletta and OGKevin authored Jan 11, 2024
1 parent 3ce15a7 commit 7b31cd9
Show file tree
Hide file tree
Showing 12 changed files with 509 additions and 100 deletions.
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kobo-test-db:
COPY +creds-aws/creds /root/.aws/credentials

RUN aws --endpoint-url http://100.82.97.39:9000 s3 cp s3://repo-obsidian-kobo-highlights-import/KoboReader.sqlite KoboReader.sqlite
SAVE ARTIFACT KoboReader.sqlite
SAVE ARTIFACT KoboReader.sqlite AS LOCAL KoboReader.sqlite

test:
FROM +node
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ bookTitle: {{title}}
| highlights | Will get replaced with the extracted highlights. | `{{highlights}}` |
| title | The title of the book | `{{title}}` |

## Highlight markers
The plugin uses comments as highlight markers, to enable support for keeping existing highlights. All content between these markers will be transferred to the updated file.

```
%%START-<MARKER IDENTIFIER>%%
--> Here you can type whatever you want, it will not be overwritten by the plugin. <--
%%START-EXTRACTED-HIGHLIGHT-<MARKER IDENTIFIER>%%
...highlight
%%END-EXTRACTED-HIGHLIGHT-<MARKER IDENTIFIER>%%
--> Here you can type whatever you want, it will not be overwritten by the plugin. <--
%%END-<MARKER IDENTIFIER>%%`
```
## Helping Screenshots

![](./README_assets/step1.png)
Expand Down
51 changes: 42 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/mocha": "10.0.6",
"@types/node": "20.10.6",
"@types/sql.js": "1.4.9",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "6.17.0",
"@typescript-eslint/parser": "6.17.0",
"builtin-modules": "3.3.0",
Expand All @@ -38,7 +39,8 @@
"esbuild-plugin-wat": "0.2.7",
"moment": "2.30.1",
"sanitize-filename-ts": "1.0.2",
"sql.js": "1.8.0"
"sql.js": "1.8.0",
"uuid": "^9.0.1"
},
"engines": {
"node": ">=18.0.0 <21.0.0"
Expand Down
Loading

0 comments on commit 7b31cd9

Please sign in to comment.