![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2024
Device: pocketbook 740
|
Bookmarks/Annotation import and epubcfi
Hello!
I'm currently working on a script to save all my bookmarks from a PocketBook reader to calibre database. And I'm kinda stuck on getting 100% correct `start_cfi` and `end_cfi` values. As far I understood calibre uses something different from EPUB Canonical Fragment Identifiers 1.1 as described here https://w3c.github.io/epub-specs/epub33/epubcfi/ Is it intended or a bug, or my understanding of epubcfi specification is incorrect? I think I have kinda working conversion algorithm but it's a little bit arcane and I'm afraid it will silently break at some annotations, and I dont have a way to test it beforehand. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,279
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre's epubcfi support was added long before that spec existed, still the basic design is similar. What's tripping you up?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2024
Device: pocketbook 740
|
Quote:
for example, given this identifier "#epubcfi(/6/68!/4/2/2/152/1:160)"
Btw, looked at the code and now I'm almost sure it is correct algo. Another question is, are there any plans to support epubcfi? I think I could help with that, but I'm very new to calibre source code ![]() |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,279
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No plans. I know of no use for epubcfi() as defined in that spec.
Your source epubcfi() is from a PocketBook, I assume. What's the add extra /2 at the beginning for? And yes epubcfis() absolutely will not match if the structure of the books is different. |
![]() |
![]() |
![]() |
#5 | ||
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2024
Device: pocketbook 740
|
Quote:
Quote:
So first we go to a file defined by spine_index, then /2 to "enter" that docoment, and the rest of the path is the same both in standart epubcfi and calibre cfi. |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,279
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#7 | |||
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2024
Device: pocketbook 740
|
Quote:
This is from specification: Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
Tags |
annotation, bookmark, epubcfi |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
import bookmarks from a kindle to calibre? | Elaine T | Library Management | 3 | 07-15-2023 12:50 PM |
Is possibile import in kobo annotation? | biscuitsmilkegg | Devices | 3 | 06-15-2022 08:59 AM |
Importing all my bookmarks into the annotation browser | ownedbycats | Library Management | 6 | 09-25-2020 09:50 PM |
Annotation import Kindle PW3 | Quoth | Plugins | 17 | 01-11-2019 03:23 AM |
method to import bookmarks | GJSmith | Kobo Tablets | 1 | 11-24-2011 12:34 PM |