Skip to content

Used typically in quillt website, this will read a YAML file containing the expecting information and build the HTML to be included in the examples.Rmd vignette.

Usage

examples(
  yml = "examples.yml",
  caption = TRUE,
  showcaseOnly = FALSE,
  shinyOnly = FALSE,
  ncol = 3
)

template_examples_resource_files(yml = "examples.yml")

Arguments

yml

Path to the YAML file.

caption

if FALSE, the title won't be shown as caption below the image.

showcaseOnly

if TRUE, only the element with showcase: TRUE in YAML will be shown.

shinyOnly

if TRUE, only the element with shiny: TRUE in YAML will be shown.

ncol

Number of column for the grid : 3 (default) or 2.

Functions

  • examples(): Create the HTML for an Examples showcase page

  • template_examples_resource_files(): Produce resource_files YAML for images with relative URLs in the examples YAML file

YAML structure

The YAML should be following this example

- title: title to use as tooltip and caption # mandatory
  href: link to use when the image or caption is clicked # mandatory
  img: link to the image to use in thumbnail # mandatory
  source: link to the source repo to link to from the caption # optional
  showcase: set to FALSE if you want to filter out # optional
  shiny: set to TRUE if shiny example # optional

See existing pkgdown website using quillt for examples