Skip to content

docs: Break lines at meaning boundaries - #252

Open
krlmlr wants to merge 6 commits into
claude/badge-harmonizationfrom
claude/sembr
Open

krlmlr wants to merge 6 commits into
claude/badge-harmonizationfrom
claude/sembr

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Member

Replaces #247, which had its head on a fork and so could not join the pull request stack. Same branch, same commits.

Reformatting only, no wording changes. Prose in README.Rmd, the vignette, and the roxygen and inline comments under R/ now breaks at sentence and clause boundaries rather than wrapping to a fixed width.

The payoff is sentence-level diffs. A reworded sentence touches one line instead of reflowing the paragraph around it, so review sees the change and not the rewrap.

man/ is left to CI

man/*.Rd is not edited by hand here. roxygen2 passes source line breaks straight through to the .Rd, so reformatting the sources does move the generated files — but they are generated output, and the Commit and push the generated changes step after Roxygenize regenerates and commits them, so they arrive on this branch as an automated commit rather than in the hand-written diff, which stays prose only. The README was rendered twice, byte-identical both times.

The joined sentences, and the sentence gap

Several roxygen blocks in R/criterion.R and R/thisfile.R carried two or three sentences on one very long line. They were joined on purpose: a line break between two sentences drops the second of the two spaces that separate them, because commonmark discards the whitespace a line break stands for, so keeping the sentences on one line was the only way to keep the gap. The last commit takes the joins out, so every sentence starts a line again and long sentences break at clause boundaries.

That is the one place where this branch on its own changes rendered help: with a stock roxygen2 those sentence pairs come out with one space between them instead of two. tools::Rd2txt() over the 6 topics whose .Rd changed puts 2 of them in that position — in thisfile.Rd, script. This is becomes script. This is, and root_criterion.Rd moves the same way. Restoring the gap needs a patched roxygen2, which is a separate decision: it is #250, stacked on top of this chain, and can be taken or left on its own.

The chunk hook that normalises the temporary directory was not touched.

Part of a fleet-wide pass. r-lib/here#195 is the reference PR, reviewed by hand before the rest were run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m


Generated by Claude Code

@krlmlr
krlmlr added this pull request to stack #256 September 13, 2026 21:48
krlmlr and others added 6 commits September 14, 2026 05:56
Reformatting only, no wording changes: prose in README.Rmd, the
vignettes and the roxygen and inline comments under R/ now breaks at
sentence and clause boundaries rather than wrapping to a fixed width.

The payoff is sentence-level diffs. A reworded sentence touches one
line instead of reflowing the paragraph around it, so review sees the
change and not the rewrap.

man/*.Rd is regenerated because roxygen2 passes source line breaks
through to the .Rd. The rendered help is byte-identical -- checked with
tools::Rd2txt() over every topic -- as is the rendered README.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
A sentence that spans more than one line now starts at the beginning of
a line, and so does the sentence after it. Three roxygen paragraphs
carried a sentence boundary mid-line while one of the two sentences was
itself broken.

Where the two sentences are separated by a double space, breaking at
that boundary is not an option: roxygen2 strips leading and trailing
whitespace from continuation lines, so the gap would collapse to one
space in the rendered help. Those sentences are joined onto one long
line instead. The line runs past 140 columns, which changes nothing a
reader sees.

man/*.Rd is regenerated because roxygen2 passes source line breaks
through to the .Rd. The rendered help is byte-identical -- checked with
tools::Rd2txt() over every topic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Continuation lines in roxygen blocks now carry two spaces after the
comment marker instead of one, so that a sentence which starts on its
own line keeps a full sentence gap in the rendered help.

In this package the indent is source style only, and man/*.Rd is not
regenerated: the package sets `Roxygen: list(markdown = TRUE)`, and in
markdown mode roxygen2 strips the leading whitespace of every
continuation line before it reaches the .Rd -- measured here, in
`@description`, `@details`, `@return` and in raw Rd inside `\describe{}`
alike.

For the same reason the three long lines in `R/criterion.R` and
`R/thisfile.R` stay joined. They exist because a sentence pair is
separated by two spaces, and breaking them was measured to render as a
single space, which is a loss of a sentence gap rather than a gain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The two-space continuation indent never reached the `.Rd`:
this package sets `Roxygen: list(markdown = TRUE)`,
and commonmark strips the leading whitespace of a continuation line before the help page is written.

The sentence gap now comes from roxygen2 itself,
which indents the line break at the point where the break is emitted,
so the source-level indent is redundant.

`man/` is unaffected either way.
Reverting rather than substituting also restores the paragraph and tag alignment that the indent pass changed along the way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Several roxygen blocks carried two or three sentences on one very long line.
They were joined on purpose:
a line break between two sentences used to drop the second of the two spaces that separate them,
because commonmark discards the whitespace a line break stands for.
Keeping the sentences on one line was the only way to keep the gap.

The joins come out all the same:
every sentence starts a line again, and long sentences break at clause boundaries.

Reformatting only, no wording changes.

man/ is left to CI, which regenerates it from these sources.

A line break which follows the end of a sentence currently renders as one space rather than two.
Restoring that gap needs a patched roxygen2, which is a separate decision and a separate pull request,
so it is deliberately not part of this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
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 this pull request may close these issues.

1 participant