docs: Break lines at meaning boundaries - #57
Open
krlmlr wants to merge 5 commits into
Open
Conversation
This was referenced Sep 13, 2026
krlmlr
force-pushed
the
claude/sembr
branch
2 times, most recently
from
September 13, 2026 18:24
190381e to
d866930
Compare
krlmlr
force-pushed
the
claude/sembr
branch
2 times, most recently
from
September 13, 2026 20:33
40df43f to
b223c4a
Compare
krlmlr
added this pull request to stack #63
September 13, 2026 21:41
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
krlmlr
force-pushed
the
claude/sembr
branch
from
September 13, 2026 21:41
b223c4a to
e88a2b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reformatting only, no wording changes. The prose in
README.Rmdand the roxygen comments underR/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_*()andns_*()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 CINothing under
man/is edited by hand here. roxygen2 passes source line breaks straight through to the.Rd, so 12 topics do change — but they are generated output, and this repository'sR-CMD-check.yamlroxygenises and commits the result itself, so they arrive on this branch as an automated commit rather than in the hand-written diff.Verified:
tools::Rd2txt()output, fromman/regenerated with roxygen2 8.1.0.9000 (the versionConfig/roxygen2/versionpins), is byte-identical for the 12 topics whose.Rdthis branch changes, before and after, so the rendered help does not move. It moves only where a sentence pair separated by two spaces is broken across lines, because the break swallows one of the spaces; no such pair was broken here. A word-level comparison (comment markers stripped, whitespace collapsed) is identical for every one of the 14 changed sources.README.mdandindex.mdwere re-rendered and render deterministically — two consecutive renders are byte-identical.R CMD check --as-cranreports 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:
@usageand@examplesblocks (code, where line breaks are literal), the\describe{}/\itemize{}markup itself,NEWS.md, and the already-conforming prose inR/files.Rand the netzschleuder description. InsideR/yeast.Rtwo\itementries 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 thatRd2txt()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 = TRUEin itsRoxygenfield, 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 diffbetween 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.Rmdcarries 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