Skip to contents

Pulls out a code snippet based on a start and end tags as comments within the code

Usage

code_snip(
  type,
  filename,
  startMatches = "START",
  endMatches = "END",
  includeStart = FALSE,
  includeEnd = FALSE,
  sep = "\n...\n"
)

Arguments

type

the code type

filename

the source code file

startMatches

a regex that matched start lines

endMatches

a regex that matches end lines

includeStart

is the regex inclusive of the start line or not

includeEnd

is the regex inclusive of the end line or not

sep

a seperator

Value

a text string of the selected code