Learn R Programming

teal.reporter (version 0.4.0)

HTMLBlock: HTMLBlock

Description

Specialized FileBlock for managing HTML content in reports. It's designed to handle various HTML content, and render the report as HTML, however htmlwidgets objects can also be rendered to static document-ready format.

Arguments

Super class

teal.reporter::ContentBlock -> HTMLBlock

Methods

Inherited methods


Method new()

Initialize a HTMLBlock object.

Usage

HTMLBlock$new(content)

Arguments

content

An object that can be rendered as a HTML content assigned to this HTMLBlock

Returns

Object of class HTMLBlock, invisibly.


Method from_list()

Create the HTMLBlock from a list.

Usage

HTMLBlock$from_list(x)

Arguments

x

(named list) with a single field content containing shiny.tag, shiny.tag.list or htmlwidget.

Returns

self, invisibly.

Examples

HTMLBlock <- getFromNamespace("HTMLBlock", "teal.reporter")
block <- HTMLBlock$new()
block$from_list(list(content = shiny::tags$div("test")))


Method to_list()

Convert the HTMLBlock to a list.

Usage

HTMLBlock$to_list()

Returns

named list with a text and style.

Examples

HTMLBlock <- getFromNamespace("HTMLBlock", "teal.reporter")
block <- HTMLBlock$new(shiny::tags$div("test"))
block$to_list()


Method clone()

The objects of this class are cloneable with this method.

Usage

HTMLBlock$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code

## ------------------------------------------------
## Method `HTMLBlock$from_list`
## ------------------------------------------------

HTMLBlock <- getFromNamespace("HTMLBlock", "teal.reporter")
block <- HTMLBlock$new()
block$from_list(list(content = shiny::tags$div("test")))


## ------------------------------------------------
## Method `HTMLBlock$to_list`
## ------------------------------------------------

HTMLBlock <- getFromNamespace("HTMLBlock", "teal.reporter")
block <- HTMLBlock$new(shiny::tags$div("test"))
block$to_list()

Run the code above in your browser using DataLab