aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-10-07 20:49:11 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-10-07 20:49:11 -0300
commit00a5863f4fab30fd7aec42d971dfb851f5cf22d1 (patch)
treeb2eaef3cd5ff4cb8709e729772476d2d11200fa0
parent4aeb44bb03532aa35592d25759e51d57c2cca179 (diff)
downloadutils-doc-00a5863f4fab30fd7aec42d971dfb851f5cf22d1.tar.gz
utils-doc-00a5863f4fab30fd7aec42d971dfb851f5cf22d1.tar.bz2
Fix: export-koreader-note: annotations handling
-rwxr-xr-xexport-koreader-note15
1 files changed, 12 insertions, 3 deletions
diff --git a/export-koreader-note b/export-koreader-note
index ae2e0ef..307e575 100755
--- a/export-koreader-note
+++ b/export-koreader-note
@@ -30,9 +30,10 @@ else
end
-- Load metadata
-content = assert(loadfile(file))
-data = content()
-bookmarks = data.bookmarks
+content = assert(loadfile(file))
+data = content()
+bookmarks = data.bookmarks
+annotations = data.annotations
-- Sort
table.sort(bookmarks, compare)
@@ -44,3 +45,11 @@ for key, item in ipairs(bookmarks) do
print('> ' .. item.notes)
print('')
end
+
+-- Iterate over annotations
+for key, item in ipairs(annotations) do
+ print('Page ' .. item.page .. ':')
+ print('')
+ print('> ' .. item.text)
+ print('')
+end