baskerville / plato

Document reader
Other
1.26k stars 105 forks source link

Expose document progress to hooks #261

Open Jesse-Bakker opened 2 years ago

Jesse-Bakker commented 2 years ago

A hook I would love to implement is progress synchronization across devices. At the moment, reading progress is however not exposed to hooks.

Currently, reading progress is internally converted to "pages", but for reflowable documents, such as epub, that is not ideal, as the page number calculation is specific to plato. Of course, a hook implementation could work around that, but I'd suggest exposing reading progress as both page number and optionally a format specific link, which would link to the last viewed element (such as a page for pdf, or epubcfi for epub).