extract_prose: Extracts prose from an R Markdown or Quarto file, removing...

View source: R/extract_prose.R

extract_proseR Documentation

Extracts prose from an R Markdown or Quarto file, removing yaml header, code, comments, and callout formatting.

Description

This function takes a file path as input and reads the contents of the file. It then removes code chunks, HTML comments, YAML metadata, inline code, inline attributes, colons, and excess whitespace to extract the prose from the file.

Usage

extract_prose(file_path)

Arguments

file_path

The path to the file to extract prose from.

Value

A character vector containing the extracted prose.

Examples

## Not run: 
file_path <- "/path/to/file.Rmd"
prose <- extract_prose(file_path)
print(prose)

## End(Not run)

francojc/francojcr documentation built on Feb. 1, 2024, 9:56 p.m.