as.tags.lorem: Render placeholder text as HTML tags

View source: R/render.R

as.tags.loremR Documentation

Render placeholder text as HTML tags

Description

Renders ipsum() placeholder text as HTML tags using htmltools::as.tags(). By default, paragraphs are rendering ⁠<p>⁠ tags with htmltools::p(), but you may provide your own paragraph wrapper function. In general, you won't need to manually call this function, instead you can just drop ipsum() text into another htmltools::tag().

Usage

## S3 method for class 'lorem'
as.tags(x, wrapper = NULL, ...)

Arguments

x

Object to be converted.

wrapper

A function that takes a character string of a paragraph or chunk of placeholder text and returns an htmltools::tag(). By default, lorem ipsum text is wrapped in htmltools::p().

...

Any additional parameters.

Value

Returns an htmltools::tagList().

Examples

htmltools::div(
  lorem::ipsum(paragraphs = 3)
)

htmltools::tags$ul(
  htmltools::as.tags(
    lorem::ipsum(paragraphs = 3, sentences = 1),
    wrapper = htmltools::tags$li
  )
)


lorem documentation built on March 31, 2023, 6:15 p.m.