| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/convert.R |
| 3 |
\name{Pandoc.convert} |
| 4 |
\alias{Pandoc.convert} |
| 5 |
\title{Converts Pandoc to other format} |
| 6 |
\usage{ |
| 7 |
Pandoc.convert( |
| 8 |
f, |
| 9 |
text, |
| 10 |
format = "html", |
| 11 |
open = TRUE, |
| 12 |
options = "", |
| 13 |
footer = FALSE, |
| 14 |
proc.time, |
| 15 |
portable.html = TRUE, |
| 16 |
pandoc.binary = panderOptions("pandoc.binary") |
| 17 |
) |
| 18 |
} |
| 19 |
\arguments{ |
| 20 |
\item{f}{Pandoc's markdown format file path. If URL is provided then the generated file's path is \code{tempfile()} but please bear in mind that this way only images with absolute path would shown up in the document.} |
| 21 |
|
| 22 |
\item{text}{Pandoc's markdown format character vector. Treated as the content of \code{f} file - so the \code{f} parameter is ignored. The generated file's path is \code{tempfile()}.} |
| 23 |
|
| 24 |
\item{format}{required output format. For all possible values here check out Pandoc homepage: \url{https://johnmacfarlane.net/pandoc/}} |
| 25 |
|
| 26 |
\item{open}{try to open converted document with operating system's default program} |
| 27 |
|
| 28 |
\item{options}{optionally passed arguments to Pandoc (instead of \code{pander}'s default)} |
| 29 |
|
| 30 |
\item{footer}{add footer to document with meta-information} |
| 31 |
|
| 32 |
\item{proc.time}{optionally passed number in seconds which would be shown in the generated document's footer} |
| 33 |
|
| 34 |
\item{portable.html}{instead of using local files, rather linking JS/CSS files to an online CDN for portability and including base64-encoded images if converting to \code{HTML} without custom \code{options}} |
| 35 |
|
| 36 |
\item{pandoc.binary}{custom path to \code{pandoc}'s binary if not found in the path or not set in the \code{RSTUDIO_PANDOC} env var} |
| 37 |
} |
| 38 |
\value{ |
| 39 |
Converted file's path. |
| 40 |
} |
| 41 |
\description{ |
| 42 |
Calling John MacFarlane's great program to convert specified file (see \code{f} parameter below) or character vector (see \code{text} parameter) to other formats like \code{HTML}, \code{pdf}, \code{docx}, \code{odt} etc. |
| 43 |
} |
| 44 |
\note{ |
| 45 |
This function depends on \code{Pandoc} which should be pre-installed on user's machine. See the \code{INSTALL} file of the package. |
| 46 |
} |
| 47 |
\examples{ |
| 48 |
\dontrun{ |
| 49 |
Pandoc.convert(text = c('# Demo', 'with a paragraph')) |
| 50 |
Pandoc.convert('https://rapporter.github.io/pander/minimal.md') |
| 51 |
# Note: the generated HTML is not showing images with relative path from the above file. |
| 52 |
# Based on that `pdf`, `docx` etc. formats would not work! If you want to convert an |
| 53 |
# online markdown file to other formats with this function, please pre-process the file |
| 54 |
# to have absolute paths instead. |
| 55 |
} |
| 56 |
} |
| 57 |
\references{ |
| 58 |
John MacFarlane (2012): _Pandoc User's Guide_. \url{https://johnmacfarlane.net/pandoc/README.html} |
| 59 |
} |