-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extend function to check if a file is a suitable .Rmd and to handle t…
…he rendering, as well as derive title from the YAML frontmatter
- Loading branch information
Showing
6 changed files
with
95 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' @title Check a file is postable article | ||
#' @description Will check file is readable and extention is .Rmd | ||
#' @param file file path | ||
#' @return TRUE, or FALSE with message | ||
#' @details DETAILS | ||
#' @examples | ||
#' \dontrun{ | ||
#' if(interactive()){ | ||
#' is_postable_Rmd("./my/file.Rmd) | ||
#' attr(is_postable_Rmd("./my/file.Rmd), "msg") | ||
#' } | ||
#' } | ||
#' @seealso | ||
#' \code{\link[assertthat]{assert_that}},\code{\link[assertthat]{assertions-file}} | ||
#' @rdname is_postable_Rmd | ||
#' @export | ||
#' @importFrom assertthat see_if is.readable has_extension | ||
is_postable_Rmd <- function(file) { | ||
assertthat::see_if( | ||
assertthat::is.readable(file), | ||
assertthat::has_extension(file, "Rmd") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.