added rk.check_for_pandoc() function to rkward package

parent e3a256dc
......@@ -57,6 +57,7 @@ export(rk.askYesNo)
export(rk.assign.preview.data)
export(rk.call.plugin)
export(rk.capture.output)
export(rk.check_for_pandoc)
export(rk.clear.plot.history)
export(rk.demo)
export(rk.describe.alternative)
......
#' Check for pandoc installation and its features
#'
#' This function looks for a pandoc installation and if found, gathers information
#' on its path, supported output formats, and the version number. It has no parameters.
#'
#' @return A named list with at least the boolean element \code{available}, and if
#' that is \code{TRUE}, also the character vectors \code{path}, \code{output_formats}, and \code{version}.
#' @author Meik Michalke \email{rkward-devel@@kde.org}
#' @seealso \code{\link{rk.sessionInfo}}
#' @keywords utilities misc
#' @export
#' @rdname rk.check_for_pandoc
#' @examples
#'
#' rk.check_for_pandoc()
"rk.check_for_pandoc" <- function(){
pandoc <- list(available=FALSE)
pandoc_path <- Sys.which("pandoc")[["pandoc"]]
if(!"" %in% pandoc_path){
pandoc[["path"]] <- pandoc_path
pandoc[["available"]] <- TRUE
pandoc[["output_formats"]] <- system("pandoc --list-output-formats", intern=TRUE)
pandoc[["version"]] <- gsub("[[:space:]]*pandoc[[:space:]]*", "", system("pandoc --version", intern=TRUE)[1])
} else {}
return(pandoc)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rk.check_for_pandoc.R
\name{rk.check_for_pandoc}
\alias{rk.check_for_pandoc}
\title{Check for pandoc installation and its features}
\usage{
rk.check_for_pandoc()
}
\value{
A named list with at least the boolean element \code{available}, and if
that is \code{TRUE}, also the character vectors \code{path}, \code{output_formats},
and \code{version}.
}
\description{
This function looks for a pandoc installation and if found, gathers information
on its path, supported output formats, and the version number. It has no parameters.
}
\examples{
rk.check_for_pandoc()
}
\seealso{
\code{\link{rk.sessionInfo}}
}
\author{
Meik Michalke \email{rkward-devel@kde.org}
}
\keyword{misc}
\keyword{utilities}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment