R/depreciated/news_note.R

Defines functions news_note

#' Build a NEWS.md to write down development notes.

#' @author Jiaxiang Li
#'
#' @import rstudioapi
#' @import clipr
#' @importFrom glue glue
#' @importFrom xfun write_utf8
#' @importFrom stringr str_c
#' @export


news_note <- function(){
    name <- "NEWS.md"
    if (file.exists(name)) {
        stop('NEWS.md already exists.')
    }
    now <- pn()
    input <- glue::glue("### {now}\n
                        ")
    xfun::write_utf8(input,name)
    text <-
        stringr::str_c(name,' is already built.')
    cat(
        sep="\n"
        ,text
        ,tips()
    )
    rstudioapi::navigateToFile(name)
    rstudioapi::setCursorPosition(Inf)
}
JiaxiangBU/add2md documentation built on Jan. 31, 2020, 7:46 p.m.