docs: rewrite README for a stranger
Reordered around a new user: what the data is, where it comes from, install, a quickstart that runs with no configuration, then the full-dollars warning and the concepts that decide whether a published number is right. Adds a 'Where the data comes from' section linking the API documentation site, the live API, the Hugging Face corpus and the Census source, so attribution and provenance are reachable from the top rather than implied. Drops the sibling-repo path, the commented-out install line, the Status block, and the release advice telling you to strip the fixture -- which would break the vignette and leave public CI unable to check without credentials. The quickstart passes years=; cog_spending() has no full-history default, so the obvious one-liner errors on a reader's first call.
This commit is contained in:
@@ -145,3 +145,23 @@ test_that("_pkgdown.yml indexes every exported topic", {
|
||||
# means the docs site does not build at all.
|
||||
expect_equal(missing, character(0))
|
||||
})
|
||||
|
||||
test_that("README is written for a stranger, not a repo insider", {
|
||||
skip_if_no_source_tree("README.md")
|
||||
r <- paste(readLines(source_tree_path("README.md"), warn = FALSE), collapse = "\n")
|
||||
|
||||
# No paths that only resolve inside a maintainer's checkout.
|
||||
expect_false(grepl("../cog_pipeline", r, fixed = TRUE))
|
||||
# A real, uncommented install line.
|
||||
expect_match(r, "install.packages", fixed = TRUE)
|
||||
expect_false(grepl("# pak::pkg_install", r, fixed = TRUE))
|
||||
# The errata most likely to produce a plausible-looking wrong answer.
|
||||
expect_match(r, "full US dollars", fixed = TRUE)
|
||||
# The release advice that conflicts with public CI is gone.
|
||||
expect_false(grepl("Rbuildignore", r, fixed = TRUE))
|
||||
# Both read paths documented.
|
||||
expect_match(r, "cog_mirror", fixed = TRUE)
|
||||
# cog_spending() has no default for `years`; a quickstart that omits it
|
||||
# errors on the reader's first call.
|
||||
expect_match(r, "years\\s*=", perl = TRUE)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user