Skip to content

Document datasets: the quoted-string directive, @format, and @source - #38

Merged
TroyHernandez merged 3 commits into
mainfrom
data-doc-directive
Aug 31, 2026
Merged

TroyHernandez merged 3 commits into
mainfrom
data-doc-directive

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

A roxygen block over a bare "name" line is the standard way to document a dataset, and tinyrox dropped it silently: the string literal matched no assignment pattern, so the block never became an object, no Rd was written, and no warning said so. R CMD check then reports the dataset undocumented. Found standing up examen's are dataset.

  • parse_object_definition() recognises "name" / 'name' as a data directive, next to the existing "_PACKAGE" sentinel (both quote styles; the sentinel keeps its own type).
  • @format and @source join the supported tags instead of warning as unknown.
  • generate_data_rd() prefers the author's @format (markup preserved) over the auto-introspected fallback, and emits \source{}.

Tests: a directive unit-parse in test_parse.R and a full document() acceptance run in test_rd.R asserting the Rd carries \docType{data}, the @format describe block, \source{}, \keyword{datasets}, and no NAMESPACE export. Suite at 405 asserts, all passing. The consumer proof: examen's man/are.Rd now generates and its R CMD check runs 0 errors, 0 warnings.

A roxygen block over a bare "name" line is the standard way to
document a dataset, and tinyrox dropped it silently: the string
literal matched no assignment pattern, so the block never became an
object, no Rd was written, and no warning said so. R CMD check then
reports the dataset undocumented (found standing up examen's are
dataset).

parse_object_definition() now recognises "name" / 'name' as a data
directive, next to the existing "_PACKAGE" sentinel. @Format and
@source join the supported tags; generate_data_rd() prefers the
author's @Format over the auto-introspected fallback and emits
\source{}. Two new tests: the directive unit-parse and a full
document() acceptance run with @Format markup and @source.
@TroyHernandez
TroyHernandez merged commit 9d38e9f into main Aug 31, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the data-doc-directive branch August 31, 2026 21:00
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