pandoc_convert {pandoc} | R Documentation |
Run Pandoc to convert a document or a text
Description
Main usage of Pandoc is to convert some text from a format into another. This function will do just that:
converting from a file or directly from text
writing to a file or directly to console
Usage
pandoc_convert(
file = NULL,
text = NULL,
from = "markdown",
to,
output = NULL,
standalone = FALSE,
args = c(),
version = "default"
)
Arguments
file , text |
One or the other should be provided |
from |
Format to convert from. This must be one of the format supported
by Pandoc. Default will be |
to |
Format to convert to. This must be one of the format supported by
Pandoc. This correspond to the |
output |
Pass a path to a file to write the result from Pandoc
conversion into a file. This corresponds to the |
standalone |
Should appropriate header and footer be included ?
This corresponds to |
args |
Any other flag supported by Pandoc CLI. See https://pandoc.org/MANUAL.html#options |
version |
Version to use. Default will be the
|
Value
output
is provided, the absolute file path. If not, the output of
pandoc
binary run.
Examples
pandoc::pandoc_convert(text = "_This will be emphasize_", to = "latex")
pandoc::pandoc_convert(text = "**This will be bold**", to = "html", version = "2.11.4")