make_heading_table: Create a table for headings

View source: R/make_heading_table.R

make_heading_tableR Documentation

Create a table for headings

Description

Create a table for headings

Usage

make_heading_table(headings, offset = 5L)

Arguments

headings

an xml_nodeset object with text and "level" attributes

offest

the offset for the yaml header (artifact of tinkr), defaults to 5L, which is for the two fences plus title, teaching, and exercises.

Value

a data frame with three columns:

  • heading the text of the heading

  • level the heading level

  • pos the position of the heading in the document

  • node the node containing the heading

Examples

path <- file.path(lesson_fragment(), "_episodes", "14-looping-data-sets.md")
loop <- Episode$new(path)
pegboard:::make_heading_table(loop$headings, offset = length(loop$yaml))

carpentries/pegboard documentation built on Nov. 13, 2024, 8:53 a.m.