-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for importing KOReader & Calibre annotations (#4780)
- Loading branch information
1 parent
d3456b0
commit 9f8c5c8
Showing
11 changed files
with
494 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule reader
updated
11 files
+1 −1 | epubjs/epub.js | |
+27 −0 | package-lock.json | |
+2 −0 | package.json | |
+34 −0 | src/common/reader.js | |
+1 −1 | src/dom/common/lib/range.ts | |
+128 −1 | src/dom/epub/epub-view.ts | |
+84 −0 | src/dom/epub/lib/calibre.ts | |
+148 −0 | src/dom/epub/lib/koreader.ts | |
+1 −1 | src/dom/epub/lib/page-mapping.ts | |
+3 −3 | src/dom/epub/lib/sanitize-and-render.ts | |
+6 −0 | webpack.config.js |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
-- /home/user/Downloads/herman-melville_moby-dick.sdr/metadata.epub.lua | ||
return { | ||
["annotations"] = { | ||
[1] = { | ||
["chapter"] = "Extracts", | ||
["datetime"] = "2024-10-23 09:28:47", | ||
["drawer"] = "lighten", | ||
["note"] = "this is a test note", | ||
["page"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/p/text().4", | ||
["pageno"] = 10, | ||
["pos0"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/p/text().4", | ||
["pos1"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/p/text().119", | ||
["text"] = "visited this country also with a view of catching horse-whales, which had bones of very great value for their teeth", | ||
}, | ||
[2] = { | ||
["chapter"] = "Extracts", | ||
["datetime"] = "2024-10-23 09:28:41", | ||
["drawer"] = "lighten", | ||
["page"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/cite/text()[1].50", | ||
["pageno"] = 10, | ||
["pos0"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/cite/text()[1].50", | ||
["pos1"] = "/body/DocFragment[5]/body/section/section/blockquote[9]/cite/text()[1].75", | ||
["text"] = "his mouth by King Alfred", | ||
}, | ||
}, | ||
["cache_file_path"] = "/home/user/.config/koreader/cache/cr3cache/herman-melvi-by-dick.epub.a2cc4d69.1.cr3", | ||
["config_panel_index"] = 1, | ||
["copt_b_page_margin"] = 15, | ||
["copt_block_rendering_mode"] = 3, | ||
["copt_cjk_width_scaling"] = 100, | ||
["copt_embedded_css"] = 1, | ||
["copt_embedded_fonts"] = 1, | ||
["copt_font_base_weight"] = 0, | ||
["copt_font_gamma"] = 15, | ||
["copt_font_hinting"] = 2, | ||
["copt_font_kerning"] = 3, | ||
["copt_font_size"] = 22, | ||
["copt_h_page_margins"] = { | ||
[1] = 10, | ||
[2] = 10, | ||
}, | ||
["copt_line_spacing"] = 100, | ||
["copt_nightmode_images"] = 1, | ||
["copt_render_dpi"] = 96, | ||
["copt_rotation_mode"] = 0, | ||
["copt_smooth_scaling"] = 0, | ||
["copt_status_line"] = 1, | ||
["copt_sync_t_b_page_margins"] = 0, | ||
["copt_t_page_margin"] = 15, | ||
["copt_view_mode"] = 0, | ||
["copt_visible_pages"] = 1, | ||
["copt_word_expansion"] = 0, | ||
["copt_word_spacing"] = { | ||
[1] = 95, | ||
[2] = 75, | ||
}, | ||
["cre_dom_version"] = 20240114, | ||
["css"] = "./data/epub.css", | ||
["doc_pages"] = 1068, | ||
["doc_path"] = "/home/user/Downloads/herman-melville_moby-dick.epub", | ||
["doc_props"] = { | ||
["authors"] = "Herman Melville", | ||
["description"] = "Captain Ahab, having lost his leg to the white whale Moby Dick, travels the world on a quest for vengeance.", | ||
["identifiers"] = "url:https://standardebooks.org/ebooks/herman-melville/moby-dick", | ||
["keywords"] = "Whaling -- Fiction\ | ||
Sea stories\ | ||
Psychological fiction\ | ||
Ship captains -- Fiction\ | ||
Adventure stories\ | ||
Mentally ill -- Fiction\ | ||
Ahab, Captain (Fictitious character) -- Fiction\ | ||
Whales -- Fiction\ | ||
Whaling ships -- Fiction", | ||
["language"] = "en-US", | ||
["series"] = "The Guardian’s Best 100 Novels in English (2015)", | ||
["series_index"] = 17, | ||
["title"] = "Moby Dick", | ||
}, | ||
["floating_punctuation"] = 0, | ||
["font_face"] = "Noto Serif", | ||
["font_family_fonts"] = {}, | ||
["handmade_flows_edit_enabled"] = true, | ||
["handmade_flows_enabled"] = false, | ||
["handmade_toc_edit_enabled"] = true, | ||
["handmade_toc_enabled"] = false, | ||
["hide_nonlinear_flows"] = false, | ||
["highlight_drawer"] = "lighten", | ||
["hyph_force_algorithmic"] = false, | ||
["hyph_soft_hyphens_only"] = false, | ||
["hyph_trust_soft_hyphens"] = false, | ||
["hyphenation"] = true, | ||
["inverse_reading_order"] = false, | ||
["last_xpointer"] = "/body/DocFragment[5]/body/section/section/blockquote[7]/p/text().42", | ||
["page_overlap_style"] = "dim", | ||
["partial_md5_checksum"] = "24f29131f720f7c89d54476baece3657", | ||
["partial_rerendering"] = true, | ||
["percent_finished"] = 0.0093632958801498, | ||
["preferred_dictionaries"] = {}, | ||
["readermenu_tab_index"] = 3, | ||
["show_overlap_enable"] = false, | ||
["stats"] = { | ||
["authors"] = "Herman Melville", | ||
["highlights"] = 1, | ||
["language"] = "en-US", | ||
["notes"] = 1, | ||
["pages"] = 1068, | ||
["performance_in_pages"] = {}, | ||
["series"] = "The Guardian’s Best 100 Novels in English (2015) #17", | ||
["title"] = "Moby Dick", | ||
}, | ||
["summary"] = { | ||
["modified"] = "2024-10-23", | ||
["status"] = "reading", | ||
}, | ||
["text_lang"] = "en-US", | ||
["text_lang_embedded_langs"] = true, | ||
["toc_ticks_ignored_levels"] = {}, | ||
} |
Oops, something went wrong.