rename | R Documentation |
Some 'NEWS.md' files have the package name in the heading. This is not yet supported in the 'collect' code. This convenience function will help the user modify those headings to exclude the package name and include the keywords 'Changes in version' for aggregating news files across packages. Version control of the NEWS files is highly recommended. By default, the function saves a '*.bak' backup NEWS file in the package directory.
rename(pkg, backup = ".bak", dry.run = TRUE)
pkg |
character(1) The directory location of the package usually the current directory (default: ".") |
backup |
character(1) The file extension to add for backing up the original news file (default: '.bak') |
Saves a "NEWS.md" file with substituted headers
# create phony DESC for usethis
# otherwise temp 'package' is not recognized
desc <- usethis:::build_description(
basename(tempdir()), roxygen = TRUE, fields = list()
)
lines <- desc$str(by_field = TRUE, normalize = FALSE, mode = "file")
usethis:::write_over(
file.path(tempdir(), "DESCRIPTION"), lines, quiet = TRUE
)
tempNews <- file.path(tempdir(), "NEWS.md")
writeLines("# TempPackage 0.99.0", con = file(tempNews))
rename(pkg = tempdir())
readLines(tempNews)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.