rasciidoc | R Documentation |
asciidoc
FileThis is the basic interface to asciidoc
. Not more than a call to
system2
and checks on asciidoc
and
source-highlight
.
You should usually not call it directly, see
render
for a wrapper.
rasciidoc(
file_name,
...,
write_to_disk = getOption("write_to_disk"),
enforce_requirements = getOption("enforce_requirements"),
git_checkout_asciidoc_tag = NA
)
file_name |
The file to run |
... |
arguments passed to |
write_to_disk |
Write to disk? See Warning. |
enforce_requirements |
Should system requirements be enforced (CRAN
requires packages to pass checks if system requirements (external commands)
are not met)? Set to |
git_checkout_asciidoc_tag |
If
Don't mind, just stick with the default. You would have to know which python version will be used. |
Invisibly
TRUE
or
FALSE
, depending on success.
Due to the CRAN policy of not writing "anywhere else on the
file system apart from the R session's temporary directory",
we work on a temporary copy of file_name
.
Thus all internal sourcing and internal links will be
broken and any output is written to tempdir()
.
Set the option "write_to_disk" to TRUE (using
options(write_to_disk = TRUE)
to bypass this. You may want to include the above line into your
‘~/.Rprofile’.
render
# CRAN complains about elapsed times
if (fritools::is_running_on_fvafrcu_machines()) {
wd <- file.path(tempdir(), "rasciidoc")
dir.create(wd)
file <- system.file("files", "minimal", "knit.asciidoc",
package = "rasciidoc")
file.copy(file, wd)
r <- rasciidoc(file_name = file.path(wd, basename(file)),
write_to_disk = getOption("write_to_disk"), "-b html")
if (interactive()) browseURL(attr(r, "info")[["output"]])
if (isTRUE(getOption("write_to_disk"))) {
dir(wd, full.names = TRUE)
} else {
dir(tempdir(), full.names = TRUE)
}
unlink(wd, recursive = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.