Read the package news with news(), convert the result to Markdown, and write to an output file (e.g., NEWS.md). Each package version appears in a first-level header, each category (e.g., NEW FEATURES or BUG FIXES) is in a second-level header, and the news items are written into bullet lists.

news2md(package, ..., output = "NEWS.md", category = TRUE)

Arguments

package, ...

Arguments to be passed to news().

output

The output file path.

category

Whether to keep the category names.

Value

If output = NA, returns the Markdown content as a character vector, otherwise the content is written to the output file.

Examples

if (FALSE) { # interactive()
# news for the current version of R
xfun::news2md("R", Version == getRversion(), output = NA)
}