make_images_section: Make a section of aggregated images

View source: R/build_images.R

make_images_sectionR Documentation

Make a section of aggregated images

Description

This will insert xml figure nodes into the images page, printing the alt text descriptions for users who are not using screen readers.

Usage

make_images_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

See Also

build_images(), 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
  img <- get_content("images", content = "self::*", pkg = pkg)
  fig_content <- get_content("01-introduction", content = "/figure", pkg = pkg)
  make_images_section("01-introduction", contents = fig_content, parent = img)
}

zkamvar/sandpaper documentation built on April 15, 2024, 5:32 p.m.