Learn R Programming

mindr (version 1.1.5)

outline: Extract headers of markdown or rmarkdown files as an outline.

Description

Extract headers of markdown or rmarkdown files as an outline.

Usage

outline(folder = "md", pattern = "*.[R]*md", remove_curly_bracket = FALSE, 
    savefile = TRUE, savefilename = "outline", backup = TRUE, bookdown_style = TRUE)

Arguments

folder

character. The folder which contains the input file(s).

pattern

an optional regular expression for filtering the input files. See help(dir).

remove_curly_bracket

logical. Whether to remove #ID in the headers of the markdown file (usually in a 'bookdown' https://github.com/rstudio/bookdown project).

savefile

logical. Whether to save the output as a markdown file.

savefilename

character. Valid when savefile == TRUE.

backup

logical. Whether the existing target file, if any, should be saved as backups.

bookdown_style

logical. whether the markdown files are in bookdown style, i.e. index.Rmd at the beginning, # (PART), # (APPENDIX) and # References as an upper level of normal # title

Value

a vector of strings showing outline of a markdown document or book.

Examples

Run this code
# NOT RUN {
folder <- system.file("examples/md", package = "mindr")
outline(folder = folder)
outline(folder = folder, remove_curly_bracket = TRUE)
# }

Run the code above in your browser using DataLab