make_instructornotes_section: Make a section of aggregated instructor notes

View source: R/build_instructor_notes.R

make_instructornotes_sectionR Documentation

Make a section of aggregated instructor notes

Description

This will append instructor notes from the inline sections of the lesson to the instructor-notes page, separated by section and ⁠<hr>⁠ elements.

Usage

make_instructornotes_section(name, contents, parent)

Arguments

name

the name of the section, (may or may not be prefixed with ⁠images-⁠)

contents

an xml_nodeset of figure elements from get_content()

parent

the parent div of the images page

Value

the section that was added to the parent

Note

On the learner view, instructor notes will not be present

See Also

build_instructor_notes(), get_content()

Examples

if (FALSE) {
  lsn <- "/path/to/lesson"
  pkg <- pkgdown::as_pkgdown(fs::path(lsn, "site"))

  # read in the All in One page and extract its content
  notes <- get_content("instructor-notes",
    content =
      "section[@id='aggregate-instructor-notes']", pkg = pkg, instructor = TRUE
  )
  agg <- "/div[contains(@class, 'instructor-note')]//div[@class='accordion-body']"
  note_content <- get_content("01-introduction", content = agg, pkg = pkg)
  make_instructornotes_section("01-introduction",
    contents = note_content,
    parent = notes
  )

  # NOTE: if the object for "contents" ends with "_learn", no content will be
  # appended
  note_learn <- note_content
  make_instructornotes_section("01-introduction",
    contents = note_learn,
    parent = notes
  )
}

zkamvar/sandpaper documentation built on April 21, 2024, 1:17 a.m.