-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging highlights #4670
Comments
From what I understand from having read the code: I don't think the The The xpointers should be stable across devices, but there are cases when changes/fixes/new features in crengine may make them invalid. So, highlights you would took from different metadata.lua from 2 devices (for the same book) with the same You can see the historical cre_dom_version and the whys at https://github.com/koreader/crengine/blob/fca482f9c57bc8fd9a7e047b6eb6f7f6ab4211a7/crengine/src/lvtinydom.cpp#L15-L57 |
The side effect of this is that if you had opened a book in 2016, even on the laster koreader nightly version, you would request the engine to behave like it did in 2016 (even if you have never highlighted anything), so the highlight if any would still show - and you would not get some fixes and new features. The only solution to get these fixes and new features is to explicitely "Purge .sdr" (so losing your highlights), so, as there's no past, the engine will use the lastest and best dom version. |
This is very promising. It does give me something to check before creating a non working file. |
Just mentionning that for completness (I think that's no concern of yours with kohighlights): When one get this popup (from #3968, after playing with some styletweaks - mostly those with The document is fully reloaded, the DOM is rebuilt (with no cre_dom_version change), with styles that may change the xpaths, and so break some highlights. I don't know if it can be a feature or not for kohighlight to backup/save the list of styletweaks, to eventually allow restoring its state if the user feels like "damned, I lose them, fortunately I backuped them in kohighlights". (But you told me you don't do restore I think.) |
I try to avoid messing around with KoReader apart from editing the metadata files (for the comment only). |
One can have: ["style_tweaks"] = {
["lineheight_all_inherit"] = true,
["titles_page-break-before_avoid "] = true,
["widows_orphans_all_5"] = true
}, But yeah, nothing for you to worry about, you can't know from kohighlight what has happened and if some mess happened. So don't worry :) |
... and another thing ... |
It's used on the sync server, so in principle it shouldn't change. See: koreader/frontend/document/document.lua Lines 113 to 159 in f2a9ed0
The stats thing I don't know about. It looks suspiciously similar: koreader/plugins/statistics.koplugin/main.lua Lines 268 to 287 in b121581
|
I would use |
And highlight config should point to the same text regardless how the book is rendered for all document types, if not, it's a bug we need to fix. |
Added the (experimental) option to merge highlights with v0.6.1.0 |
Btw, positions too (as they are xpointers) may change when |
Well, to sync 2 books, they have to be on the same |
Yes it was. But its value is updated from the engine, with the dom version in use. So no problem if you make all that dependant of needing the same Just giving more details about this cre_dom_version: koreader/frontend/apps/reader/modules/readerrolling.lua Lines 121 to 142 in 7799093
(The comment |
So, if all the older metadata are getting a |
Yes, they do. If they have been opened with a > 201805 koreader, they will get a
There is code to use a previous setting when koreader/frontend/apps/reader/modules/readerrolling.lua Lines 144 to 158 in 7799093
|
OK then, we're all set! |
Is there something I need to do to enable the syncing of highlights between devices? Just installed the latest nightly (3/5/2019) and I don't see highlights syncing from my PW4 to my Kindle Fire Tablet... am I doing something wrong? [position syncs just fine] |
This is a third-party app. The built-in sync stuff hasn't changed in years. I think I had to restart it one or two years ago and that's about it. :-P |
So sounds like I shouldn't hold my breath for highlighting sync to be baked into Koreader ;) |
I don't think anybody's actively doing anything with it, no. :-) |
There was a question in a KoHighlights' issue from a user, about the possibility to merge different highlights from the same book in different devices.
My answer was negative at first, because I thought that with different devices, the position info in the highlight would create problems when read from other devices.
But then I thought that I don't know that for sure, so here I am, asking.
The highlight's data consists from two keys.
One in the
["bookmarks"]
key and another at the["highlight"]
key.E.g. this inside the
["bookmarks"]
and this inside the
["highlight"]
And the question is this:
If I open the same book with another device and highlight the exact same words, are the
["page"] ["pos0"] ["pos1"]
going to be the same?A second question, about the
[209]
key is:If this number is not right (since a different screen format and/or font and/or size would produce different amount of pages) what would happen to the highlight?
Is there anything else that I missed and needs to be addressed?
The text was updated successfully, but these errors were encountered: