code.listing: Read Code from a File according to Parameters given as...

Description Usage Arguments

View source: R/codeListing.R

Description

Read snippets of code from a file, put it into a code environment. If a github code repository is specified, create a source code link.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
code.listing(
  label = "",
  caption = "",
  language = "",
  path,
  lines = "",
  tags = "",
  basePath = NULL,
  repo = NULL,
  codeBlockCaptions = TRUE,
  removeMetaComments = TRUE,
  removeUnnecessary = TRUE,
  numberLines = TRUE
)

Arguments

label

the label to use

caption

the caption to put

language

the programming language

path

the path to the file to read

lines

a set of selected lines, given as R integer vector expression string

tags

the list of marking start and end given as string with comma-separated values

basePath

the base path against which the path should be resolved

repo

a link to the repository, if any is provided

codeBlockCaptions

should we have code block captions?

removeMetaComments

should the meta-comments of the programming language be removed?

removeUnnecessary

should we remove all annotations?

numberLines

should the lines be numbered?


thomasWeise/bookbuildeR documentation built on Sept. 5, 2021, 6:31 p.m.