Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable hyphenation by default #2820

Closed
dvg-p4 opened this issue Nov 19, 2024 · 5 comments · Fixed by #2822
Closed

Disable hyphenation by default #2820

dvg-p4 opened this issue Nov 19, 2024 · 5 comments · Fixed by #2822

Comments

@dvg-p4
Copy link

dvg-p4 commented Nov 19, 2024

pkgdown 2.1.0's changelog contains the following item:

Very wide words are now automatically broken across lines and hyphenated (when possible) when they’d otherwise create a horizontal scrollbar on mobile (#1888).

However, the actual change made seems to impact far more than just "very long words...on mobile". In fact, it seems to affect all content in the main body of any roxygen site page, and tends to be incredibly eager to hyphenate almost any word at the end of a line.

There are some fairly egregious examples in your own development docs:
image

... for other de-
velopers ...

... generics and class-
es, ...

And even worse, long variable or function names inside of code tags can still get hyphenated:
image

I think this loss in clarity and legibility is not at all worth it just to occasionally avoid horizontal scrollbars on mobile.

@dvg-p4
Copy link
Author

dvg-p4 commented Nov 20, 2024

another example on your main site:
image

@jayhesselberth
Copy link
Collaborator

Yikes, that is some aggressive hyphenation. We could disable, but I'm wondering if there's a better CSS approach for more conservative treatment of word breaks.

@jayhesselberth
Copy link
Collaborator

I think it should also be straightforward with CSS to completely suppress hyphenation in code blocks, but what you pasted above is not a code block, per se.

@dvg-p4
Copy link
Author

dvg-p4 commented Nov 20, 2024

They're still <code> tags, so code {hyphens:none} works there...but I'd argue that they're also a significant bane to readability in the prose text as well. It's a practice designed for full-width justified text in newspapers and books, that makes much less sense for left-justified ("ragged right") text on the web except in very particular circumstances.

As far as I can tell from a google search, the only middle ground between hyphens: auto and hyphens: none appears to be hyphens: manual, which inserts hyphens only where suggested by "soft hypen" characters (Unicode U+00AD / HTML &shy;) that are manually placed. I'm not sure if those are supported in roxygen/.Rd files generally?

@hadley
Copy link
Member

hadley commented Nov 21, 2024

Maybe we could only enable auto hyphenation when the page width is particularly narrow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants