CreDocuments: save EPubCFI alongside xpointers (last_pos, annotations)

EPubCFI is the per-EPUB-specs equivalent of our xpointers.
Save the EPubCFI version of our xpointers in metadata.epub.lua
so they can be used by plugins or external tools.
They are not used internally.
This commit is contained in:
Adam Buntain-Cooper authored and GitHub committed 2026-10-09 08:38:20 +02:00
1 parent 2adaff6e46
commit 0deae50039
7 files changed
+106 -1

No files matched your search

+17
View File
@@ -889,6 +889,22 @@ function CreDocument:getPageXPointer(page)
return self._document:getPageXPointer(page)
end
function CreDocument:getEPubCFI()
return self._document:getEPubCFI()
end
function CreDocument:getPageEPubCFI(page)
return self._document:getPageEPubCFI(page)
end
function CreDocument:getEPubCFIFromXPointer(xp)
return self._document:getEPubCFIFromXPointer(xp)
end
function CreDocument:getEPubCFIRangeFromXPointers(start_xp, end_xp)
return self._document:getEPubCFIRangeFromXPointers(start_xp, end_xp)
end
function CreDocument:isXPointerInDocument(xp)
return self._document:isXPointerInDocument(xp)
end
@@ -1932,6 +1948,7 @@ function CreDocument:setupCallCache()
elseif name == "getScreenPositionFromXPointer" then cache_by_tag = true
elseif name == "getNearestWordFromPosition" then cache_by_tag = true
elseif name == "getXPointer" then cache_by_tag = true
elseif name == "getEPubCFI" then cache_by_tag = true
elseif name == "isXPointerInCurrentPage" then cache_by_tag = true
elseif name == "getPageMapCurrentPageLabel" then cache_by_tag = true
elseif name == "getPageMapVisiblePageLabels" then cache_by_tag = true