#' @title package name
#' @description Retrieve package name
#' @param path path to package
#' @family utility
#' @export
package_name <- function(path=getwd()){
desc_path <- normalizePath(file.path(path,'DESCRIPTION'),mustWork = TRUE)
read.dcf(desc_path)[,'Package'][[1]]
}
current_hash <- function(path = '.', trim = FALSE){
this_path <- getwd()
on.exit(setwd(this_path))
hash <- NULL
if(is_git()){
setwd(path)
hash <- system('git rev-parse HEAD',intern = TRUE)
if(trim){
hash <- substring(hash,1,7)
}
}
hash
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.