foliate
foliate copied to clipboard
Ability to open book at specified position
Is your feature request related to a problem? Please describe. Would be great to be able to open book at some previously identified position. It would be useful when making annotations on book in note-taking SW like Obsidian etc. This could provide ability to proceed to related book position or fragment by following link in a note.
Describe the solution you'd like Basically I'd propose to consider two improvements:
- support EPUB CFI in command line arguments specifying file to open, so the user is able to launch Foliate like
com.github.johnfactotum.Foliate 'file:///home/user/Downloads/Alices\ Adventures\ in\ Wonderland.epub#epubcfi(/6/20!/4/2/2/1:0)'
or so (maybe worth support escaping/unescaping CFI syntax). - support custom URI scheme denoting book in library. This could be
epub
,ebook
or anything. Specific book in "path" part of URI could be represented by UUID or any supported ID. Examples:
-
epub:eb2934ae-bb1a-4652-bce7-9f78fc5ca496
for book itself -
epub:eb2934ae-bb1a-4652-bce7-9f78fc5ca496#epubcfi(/6/20!/4/2/2/1:0)
for position in book
Foliate could be associated with such scheme at system level. Using such custom scheme would allow keep links in notes alive among devices provided that user syncs also his library.
Besides position specifying fragment would be also handy. In that case I'd propose have chosen text fragment being selected at start of application.
Would be also worth adding GTK action to go to specified position or select fragment. In case of this action can be added custom scheme handler could be probably implemented outside of Foliate as separate tool. It could handle book URI with fragment, resolve it to book file using uri-store.json
(or another GTK action for library listing), open that book using existing command line interface and then command Foliate to handle positioning.
I was searching exactly for this: a way to export my annotations to Obisdian with links to open the page/note on the fly. It'd be awesome.
Regarding the first proposal, that's not currently possible as the fragment is dropped by GLib with file:
URIs: https://gitlab.gnome.org/GNOME/glib/-/issues/428. I don't think there's any way around that except using a custom URI scheme.