news {newsmd} | R Documentation |
Manipulate the NEWS.md file
Description
Manipulate the NEWS.md file.
Format
An R6 class.
Methods
Public methods
Method new()
Create a new news object.
Usage
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 )
Arguments
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.
Returns
A new 'news' object.
Method print()
Print a news object.
Usage
news$print()
Method get_text()
Get the news object as a text.
Usage
news$get_text()
Returns
The context of the news file.
Method write()
Write and save a news object.
Usage
news$write(file = "NEWS.md", reduce_dev = FALSE)
Arguments
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
Method add_version()
Adds a version line to a news object.
Usage
news$add_version(x)
Arguments
x
A string with the version number.
Method add_subtitle()
Adds a subtitle line to a news object.
Usage
news$add_subtitle(x)
Arguments
x
A string with the subtitle.
Method add_bullet()
Adds a bullet points to the last subtitle.
Usage
news$add_bullet(x)
Arguments
x
A vector with the bullet points.
Method clone()
The objects of this class are cloneable with this method.
Usage
news$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
See Also
Examples
## 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")