excerptr: Excerpt Structuring Comments and Set a Table of Contents.

Description Usage Arguments Value Examples

View source: R/excerptr.R

Description

Just a wrapper to the python function excerpts.excerpts. See https://pypi.org/project/excerpts/ for details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
excerptr(
  file_name,
  comment_character = "#",
  magic_character = "%",
  output_path = "",
  allow_pep8 = TRUE,
  prefix = "",
  postfix = "",
  run_pandoc = TRUE,
  compile_latex = FALSE,
  pandoc_formats = "tex"
)

Arguments

file_name

Name the file from which to excerpt.

comment_character

Should be "#" for R.

magic_character

The magic character marking the structuring comments in file_name.

output_path

Name the path where to output to.

allow_pep8

Don't bother. See excerpts.excerpts for details.

prefix

Give a prefix to use for output files.

postfix

Give a postfix to use for output files.

run_pandoc

Try to run pandoc on the output?

compile_latex

Try to compile LaTeX if pandoc has output LaTeX?

pandoc_formats

A character vector naming the output formats for pandoc.

Value

The status of excerpts.excerpts.

Examples

1
2
3
4
5
6
7
8
9
root <- system.file(package = "excerptr")
test_files <- file.path(root, "excerpts", "tests", "files")
if (reticulate::py_available())
    tryCatch(
             excerptr(file_name = file.path(test_files, "some_file.txt"),
                      output_path = tempdir(), run_pandoc = FALSE,
                      compile_latex = FALSE,
                      pandoc_formats = c("tex", "html")),
             error = identity)

excerptr documentation built on Aug. 5, 2021, 1:06 a.m.