Repository navigation
Export bookmarks and notes as readable text or HTML (#1106) - #1114
Open
GauravTheCoder wants to merge 2 commits into
Open
GauravTheCoder wants to merge 2 commits into
GauravTheCoder wants to merge 2 commits into
Conversation
Adds File > Export Notes and Bookmarks as Text or HTML (Ctrl+Alt+E). A dialog picks bookmarks, notes or both, whether to include each note's passage, and whether to number the entries. The save dialog offers .txt, .html and .paperback, chosen by the file's extension. The last choices are remembered.
…notations-1106 # Conflicts: # crates/paperback/src/ui/main_window/menu_file.rs # po/paperback.pot
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1106.
Adds File > Export Notes and Bookmarks as Text or HTML (Ctrl+Alt+E), so bookmarks and notes can be read without Paperback or the book. The existing
.paperbackexport is unchanged.What it does
.paperbackwrites the same transfer file as Export Document Data, so one command covers all three. The options above do not apply to it.How it works
export/annotations.rs(new) renders a list of entries to text or HTML. It is a pure function, so it is tested without a document.render_annotations_export(new,session/links.rs) builds the entries fromget_filtered_bookmarks, and gets each passage withget_line_textorget_text_range.dialogs/export_annotations.rs(new) is the options dialog. Its choices are stored under threeexport_annotations_*app settings keys, so the config schema does not change.handle_export_notes_and_bookmarks(new,menu_file.rs) shows both dialogs with the document-manager lock released, and takes it only to read the file name and to render.ActionId::ExportNotesAndBookmarkshas a default shortcut of Ctrl+Alt+E, which can be changed in Customize Keyboard Shortcuts.Known limits
.paperbackname with the Text type selected still writes a transfer file, and the reverse writes text.pbCLI options are not covered.Testing
cargo clippy --all-targetsreports no new warnings in the changed files. The workspace tests pass: paperback 144, paperback-core 1319 (24 ignored). The formatting check is clean on the pinned nightly.PAPERBACK_CONFIG_DIR), so my own bookmarks and notes were untouched.Strings
I added 12 strings to
po/paperback.pot. The other.pofiles are left for the machine-translation workflow.