Learn R Programming

lightparser (version 0.1.0)

split_to_tbl: Group lines of a Rmd or Qmd file by types in a tibble

Description

Group lines of a Rmd or Qmd file by types in a tibble

Usage

split_to_tbl(file)

Value

A tibble with 6 columns:

  • type: type of the part (yaml, heading, inline, block)

  • label: label of the part (if any)

  • params: parameters of the part (if any)

  • text: text of the part (if any)

  • code: code of the part (if any)

  • heading: heading of the part (if any)

  • heading_level: level of the heading (if any)

  • section: section of the Rmd file, according to headings (if any)

Arguments

file

A Rmd or Qmd file path

Examples

Run this code
file <- system.file(
  "dev-template-parsing.Rmd",
  package = "lightparser"
)
split_to_tbl(file)

Run the code above in your browser using DataLab