-
Notifications
You must be signed in to change notification settings - Fork 0
Name Tidying
Retro-Jack edited this page Aug 6, 2026
·
1 revision
Controlled by TIDY_NAMES (default true). Set it false to leave every name exactly as pdf2epub wrote it.
Two passes over each result, in order:
-
Separator cleanup — runs of
.,_and-become single spaces, runs of whitespace collapse, and leading/trailing whitespace goes. - Title case — the first letter of each word is capitalised.
some_document-name.md -> Some Document Name.md
THE.QUICK.BROWN.FOX -> THE QUICK BROWN FOX
jack's_book -> Jack's Book
Title case only touches a lowercase letter that isn't preceded by a word character or an apostrophe. That's what keeps THE from becoming The, acronyms intact, and jack's from turning into Jack'S.
For each result folder: the top-level files first, then the folder itself.
Anything inside images/ is deliberately left alone. The generated markdown links to those files by their original names — renaming them would break every image in the document.
- A rename that would clobber an existing file or folder is refused and logged, not forced.
- A failed regex logs the failure and leaves the name untouched rather than writing a corrupted one.
- Both cases increment the
Rename errorscounter in the final report.
The logs/ folder is excluded from the pass.