Learn R Programming

mindr (version 1.3.2)

outline: Extract headings of (R) Markdown-syntax text as an outline

Description

Extract headings of (R) Markdown-syntax text as an outline

Usage

outline(
  from,
  md_list = FALSE,
  md_eq = FALSE,
  md_braces = FALSE,
  md_bookdown = FALSE,
  md_maxlevel = ""
)

Arguments

from

Character. The source text of the (R) Markdown syntax text, the R code, the FreeMind mind map code, or the path to the directory.

md_list

Logical. whether to process lists like headings in the Markdown input.

md_eq

Logical. Whether to include LaTeX equations in the Markdown input when converted to other formats.

md_braces

Logical. Whether to remove #ID in the headings of the markdown file (usually in a bookdown> project.

md_bookdown

Logical. Whether the R Markdown syntax text is in bookdown style, i.e. # (PART), # (APPENDIX), and # References as an upper level of the Level 1 heading.

md_maxlevel

Integer or ''. The maximum level of the markdown headings that are displayed in the mind map.

Value

Character, showing the outline.

Examples

Run this code
# NOT RUN {
input <- system.file("examples/mindr-md.Rmd", package = "mindr")
input_txt <- readLines(input, encoding = "UTF-8")
outline(input_txt)
outline(input_txt, md_list = TRUE, md_bookdown = TRUE)
outline(input_txt, md_list = TRUE, md_bookdown = TRUE, md_maxlevel = 2)
# }

Run the code above in your browser using DataLab