Permalink
Browse files

Added install_pandoc to the line up. I may remove this if the two aut…

…hors do not agree for me to use the function but it's terribly useful.
  • Loading branch information...
trinker committed Feb 26, 2013
1 parent fa3ccdc commit 1e8ee365a3bb941f038a0c82bdb226e371103c7f
Showing with 56 additions and 0 deletions.
  1. +1 −0 DESCRIPTION
  2. +1 −0 NAMESPACE
  3. +25 −0 R/install_pandoc.R
  4. +29 −0 man/install_pandoc.Rd
View
@@ -46,3 +46,4 @@ Collate:
'url_dl.R'
'wc.R'
'wheresPandoc.R'
'install_pandoc.R'
View
@@ -5,6 +5,7 @@ export(doc_temp)
export(folder)
export(GQ)
export(html5)
export(install_pandoc)
export(LL)
export(new_report)
export(pad)
View
@@ -0,0 +1,25 @@
#' Download Pandoc
#'
#' Download Pandoc ffrom the command line.
#'
#' @return Installs Pandoc on your system.
#' @author Gergely Daroczi and Gabor Grothendieck.
#' @references \url{http://stackoverflow.com/a/15072501/1000343}
#' \url{http://johnmacfarlane.net/pandoc/}
#' @keywords transcript
#' @seealso \code{\link[qdap]{dir_map}}
#' @export
#' @examples
#' \dontrun{
#' install_pandoc()
#' }
install_pandoc <- function() {
page <- readLines('http://code.google.com/p/pandoc/downloads/list', warn = FALSE)
pat <- "//pandoc.googlecode.com/files/pandoc-[0-9.]+-setup.exe"
line <- grep(pat, page, value = TRUE); m <- regexpr(pat, line)
url <- paste('http', regmatches(line, m), sep = ':')
tmp <- tempfile(fileext = '.exe')
download.file(url, tmp, mode = 'wb')
system(tmp)
on.exit(unlink(tmp))
}
View
@@ -0,0 +1,29 @@
\name{install_pandoc}
\alias{install_pandoc}
\title{Download Pandoc}
\usage{
install_pandoc()
}
\value{
Installs Pandoc on your system.
}
\description{
Download Pandoc ffrom the command line.
}
\examples{
\dontrun{
install_pandoc()
}
}
\author{
Gergely Daroczi and Gabor Grothendieck.
}
\references{
\url{http://stackoverflow.com/a/15072501/1000343}
\url{http://johnmacfarlane.net/pandoc/}
}
\seealso{
\code{\link[qdap]{dir_map}}
}
\keyword{transcript}

0 comments on commit 1e8ee36

Please sign in to comment.