Automatically inject soft hyphens during build
basham opened this issue · comments
Consider adding hyphenation in the build process to soften the raggedy line edges.
[Hyphenation is] mandatory for justified text; optional otherwise
In web browsers, you can exert almost no control over automatic hyphenation, so if you use CSS hyphenation, be prepared for some clunkers.
Use the ­
entity.
For the hyphenation in this book, I used Frank Liang’s hyphenation algorithm to insert optional hyphens when each page is generated. (I’ve released this code as an open-source hyphenation module for Racket.) Though CSS notionally supports hyphenation, it’s not implemented as widely as support for the optional hyphen.
Article:
https://css-tricks.com/almanac/properties/h/hyphenate/
Project repo:
https://github.com/mnater/Hyphenator