aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-06 15:19:20 -0500
committerCraig Jennings <c@cjennings.net>2026-06-06 15:19:20 -0500
commit25bde86b9edf9c23f14ddc17c8c894c7a8ea83bd (patch)
tree2af23484ee510daba945106af91f67c2d6db38fa /assets
parent6be56495a3e1e91ed2300367352f30ffa5ce3b3f (diff)
downloaddotemacs-25bde86b9edf9c23f14ddc17c8c894c7a8ea83bd.tar.gz
dotemacs-25bde86b9edf9c23f14ddc17c8c894c7a8ea83bd.zip
fix(nov): name EPUB bookmarks "Author, Title" from the filename
In a nov buffer m is bound to bookmark-set. nov's nov-bookmark-make-record names the record after the buffer name, the raw EPUB filename. So bookmarks read like "Frege_ A Guide for the Perplexed - Edward Kanterian.epub". I advise nov-bookmark-make-record to rebuild the name from the record's filename: split on the last " - " into title and author per Calibre's "<Title> - <Author>.epub" naming, restore the colon Calibre sanitized to "_ ", and reorder to "Author, Title". That book becomes "Edward Kanterian, Frege: A Guide for the Perplexed". I pulled the name from the filename rather than the embedded EPUB metadata on purpose. In real books the embedded metadata is the worse copy (truncated titles, authors in "Last, First" sort form, lost punctuation), while the filenames come from Calibre's curated database. A separate task tracks embedding the good metadata back into the files. cj/--nov-clean-title and cj/--nov-bookmark-name-from-file are pure and carry the logic. The advice is a thin wrapper. 10 ERT tests cover colon restoration, the last-separator split, and the no-separator fallback.
Diffstat (limited to 'assets')
0 files changed, 0 insertions, 0 deletions