New feature: hyphenation support using Hyphenopoly.js #34
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.
Here's a proposal for #33 .
It uses the Hyphenopoly.js library.
Hyphenopoly.js integration was not straightforward for many reasons:
math
class must not be hyphenated (otherwise, MathJax does not work properly). See/inst/resources/html/paged.html
.Hyphenopoly.setup.dontHyphenate
object.self_contained = TRUE
(but I am not familiar with these technologies). However, it seems that it is not yet possible. In this PR, the user cannot useself_contained = TRUE
with hyphenation. Be careful, I've inverted the default value forself_contained
(it could be confusing for users, tell me what do you prefer).inst/resources/js/Hyphenopoly/configHyphenopoly.js
.Hyphenopoly.require
object: I've forced the use of 6 languages. I think it would be better if the user could declare the languages with something likehtml_paged(lang = c('en-us', 'pt'), ...)
. But I did not find the way to implement such a solution. You can find the languages supported by Hyphenopoly.js ininst/resources/js/Hyphenopoly/patterns/
.