aboutsummaryrefslogtreecommitdiff
path: root/assets/test/test-html.html
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
commit47940f707aceea6066f8c9860207724c5d30f9e0 (patch)
tree76fafa9e1303c5c3a1d5c766d3693d237b029959 /assets/test/test-html.html
parent480a59f36a7e3f406847a4157f0b2c62d114af7c (diff)
downloaddotemacs-47940f707aceea6066f8c9860207724c5d30f9e0.tar.gz
dotemacs-47940f707aceea6066f8c9860207724c5d30f9e0.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/test/test-html.html')
0 files changed, 0 insertions, 0 deletions