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

View source: R/split_to_tbl.R

split_to_tblR Documentation

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)

Arguments

file

A Rmd or Qmd file path

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)

Examples

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

lightparser documentation built on May 29, 2024, 4:39 a.m.