Skip to content

docs: Break lines at meaning boundaries - #57

Open
krlmlr wants to merge 5 commits into
claude/pkgdown-harmonizationfrom
claude/sembr
Open

docs: Break lines at meaning boundaries#57
krlmlr wants to merge 5 commits into
claude/pkgdown-harmonizationfrom
claude/sembr

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Reformatting only, no wording changes. The prose in README.Rmd and the roxygen comments under R/ now break at sentence and clause boundaries instead of wrapping to a fixed width, following https://sembr.org.

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.

This package's exported surface is data, not functions, so the pass is almost entirely the roxygen that documents the eleven data sets plus the lesmis_*() and ns_*() help. Those blocks are dense with provenance — sources, citations, per-dataset licence statements — which must read exactly as before, so the verification below is the important part of this change.

man/ is left to CI

Nothing under man/ is committed here. roxygen2 passes source line breaks straight through to the .Rd, so 12 topics do change — but they are generated output, and this repository's R-CMD-check.yaml roxygenises and commits the result itself.

Verified: tools::Rd2txt() output, from man/ regenerated locally with roxygen2 8.1.0.9000 (the version Config/roxygen2/version pins), is byte-identical for all 14 topics, before and after. A word-level comparison (comment markers stripped, whitespace collapsed) is identical for every one of the 14 changed sources. README.md and index.md were re-rendered and render deterministically — two consecutive renders are byte-identical. R CMD check --as-cran reports the same 1 ERROR, 1 WARNING and 3 NOTEs as the base branch does; the error is the PDF manual failing to build for want of math fonts in this container's minimal TeX install, on a URL in the package-level help that this change does not touch.

Left alone deliberately: @usage and @examples blocks (code, where line breaks are literal), the \describe{}/\itemize{} markup itself, NEWS.md, and the already-conforming prose in R/files.R and the netzschleuder description. Inside R/yeast.R two \item entries previously broke in the middle of a \sQuote{} span; the breaks were moved outside the spans, and the exact double space inside \sQuote{cellular communication / signal transduction} is preserved verbatim. No other content changed.

The continuation-line indent, in and out again

Two of the four commits cancel: the third indented continuation lines of a roxygen paragraph with a second space after the #' marker, and the fourth takes it back out. The idea was that Rd2txt() renders a line break followed by indentation as two spaces and a bare line break as one, which would let a sentence gap survive being broken across lines.

It never did anything here. This package sets markdown = TRUE in its Roxygen field, and commonmark strips the leading whitespace of a continuation line before roxygen2 writes the topic, so the indent only ever lived in the source. It bought nothing, so it comes out.

The provenance prose is unaffected by both. The pair leaves no trace in the tree — git diff between the revision before the indent commit and the revision after it is empty — and the word-level comparison above still holds against that revision as well as against the base branch. Both commits are kept rather than squashed away, so the reasoning stays in the history.

The sentence gap is a separate decision

One consequence is worth stating plainly. A line break which follows the end of a sentence currently renders as one space, not two, so writing one sentence per line drops the sentence gap from the rendered help. Restoring it needs a patched roxygen2, which is #62, stacked on top of this chain, and can be taken or left on its own. Without it this change simply renders as the package renders today, with one space between sentences.

The chain's badge-harmonization link was skipped for this repository: README.Rmd carries Travis and AppVeyor badges but no coverage badge, so there is nothing to bring to its current form.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m

Reformatting only, no wording changes: prose in README.Rmd and the
roxygen 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, and the sentence after it, must
each begin at the start of a line. The maintainer note at the top of
README.Rmd was still wrapped to a fixed width, so two sentences started
mid-line; README.md and index.md are re-rendered from it.

The remaining detector hits are bibliographic entries in @references and
in the "Reference:" blocks of the foodwebs descriptions, where the line
breaks separate authors, title and venue rather than sentences.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Continuation lines of a roxygen paragraph now carry two spaces after `#'`
instead of one.
The first line of a paragraph, and every tag line, keeps its single space.

roxygen2 strips `#'` plus exactly one space, so the extra space reaches the `.Rd`,
and `Rd2txt()` renders a line break followed by indentation as two spaces rather than one.
That is what lets a sentence pair keep its gap across a line break.

This package sets `Roxygen: list(markdown = TRUE)`, and commonmark strips the indent again,
so here the change is a source convention only.
The rendered help is byte-identical, checked with `tools::Rd2txt()` over every topic,
and `man/` is unchanged.

Most of the dataset documentation already indents its continuation lines by three spaces,
so only four lines needed the second space.
The `\describe{}` blocks that carry the per-dataset provenance keep the indentation their structure needs.

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` files.
This package sets `markdown = TRUE` in its `Roxygen` field,
and commonmark strips the leading whitespace of a continuation line before roxygen2 writes the topic,
so the indent only ever lived in the source.
It bought nothing there, so it comes out.

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