news | R Documentation |
Manipulate the NEWS.md file.
An R6 class.
new()
Create a new news object.
news$new( text = c(paste0("## version ", version), "", "---", "", "### NEWS.md setup", "", "- added NEWS.md creation with [newsmd](https://github.com/Dschaykib/newsmd)", ""), version = "0.0.0.9000", file = NULL )
text
vector with context for the news.md file.
version
current version of the package.
file
a text file with the current news.md file. Use NULL to create new file.
A new 'news' object.
print()
Print a news object.
news$print()
get_text()
Get the news object as a text.
news$get_text()
The context of the news file.
write()
Write and save a news object.
news$write(file = "NEWS.md", reduce_dev = FALSE)
file
A path and file to where the news file is saved.
reduce_dev
A boolean, if TRUE dev version's points are combined into the next version
add_version()
Adds a version line to a news object.
news$add_version(x)
x
A string with the version number.
add_subtitle()
Adds a subtitle line to a news object.
news$add_subtitle(x)
x
A string with the subtitle.
add_bullet()
Adds a bullet points to the last subtitle.
news$add_bullet(x)
x
A vector with the bullet points.
clone()
The objects of this class are cloneable with this method.
news$clone(deep = FALSE)
deep
Whether to make a deep clone.
newsmd
## Create a template
my_news <- news$new()
my_news$add_subtitle("improved things 1")
my_news$add_bullet("point 1")
my_news$add_bullet("point 2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.