gallery_content: Gallery page content

View source: R/templates.R

gallery_contentR Documentation

Gallery page content

Description

Create the content of a gallery page based on arbitrary page content and gallery configuration.

Usage

gallery_content(..., gallery_config = NULL, class = NULL)

Arguments

...

Unnamed items defining the main content of the page.

gallery_config

The gallery site configuration. Elements $include_before and $include_after (if present) are included before and after the main content. If character, their value is wrapped inside htmltools::HTML().

class

Character vector of custom classes, added to "gallery-container".

Value

The function constructs and returns the page content as a parent htmltools::div() HTML tag object with class "gallery-container" with three div() children.

  • One containing gallery_config$include_before (if present), with class "gallery-before".

  • One wrapping the main content items ... via htmltools::tagList() content, with class "gallery-main".

  • One containing gallery_config$include_after (if present), with class "gallery-after", and are wrapped in a parent <div> with class

The returned value can be rendered as HTML using as.character().

Examples

gallery_content(
  htmltools::h2("Hello world"),
  "Welcome to the gallery content world",
  gallery_config = list(
    include_before = "before<hr/>",
    include_after = htmltools::tagList(htmltools::hr(), "after")
  ),
  class = "hello-gallery"
)


riccardoporreca/rmdgallery documentation built on Dec. 2, 2022, 10:36 p.m.