Skip to contents

Reads a markdown outline and splits it at each level-two (##) heading. Every heading becomes one chapter; the bullet points beneath it become that chapter's sections. Bullets indented by two or more spaces are treated as sub-points and are nested one heading level deeper.

Usage

parse_schedule(path = "schedule.md")

Arguments

path

Path to a markdown outline. Defaults to "schedule.md".

Value

A list of sections, each a list with elements:

title

The heading text, without the leading ##.

bullets

Character vector of bullet lines, indentation intact.

Examples

schedule <- system.file("extdata", "schedule.md", package = "rithmatist")
sections <- parse_schedule(schedule)
length(sections)
#> [1] 6
sections[[1]]$title
#> [1] "Project Organisation"