faq: Generate a Frequently Asked Questions (FAQ) widget

Description Usage Arguments Details Value Examples

Description

Generate a widget that displays FAQs in an information/about section of an app.

Usage

1
2
faq(faqlist, id, format = "bscollapse", bscollapse_args = list(id =
  "faq", open = NULL, multiple = FALSE))

Arguments

faqlist

a prepared list of FAQs. See details.

id

character, the id for the shinyBS::bsCollapse element.

format

character, "bscollapse" (default) or alternatively, "list".

bscollapse_args

a list of arguments passed to bsCollapse. Defaults to list(id = "faq", open = NULL, multiple = FALSE).

Details

faq creates an FAQ widget from a named list. It returns a Bootstrap Collapse menu FAQ format by default. Changing to format = "list" simply passes through the original faqlist.

Generally, an FAQ list is a named list that is prepared in advance and passed to faqlist. The names of the list elements are used for indexing the list with id. It is designed this way in the context of reusable FAQ list dictionaries, where each use does not require all entries. Each list element in faqlist is a length-2 list. The first element is the question: a character string. The second element is the answer: any text or HTML content, e.g., multiple tags wrapped in a tag list.

A key difference with the open argument that can be passed in a list to bscollapse_args is that it must simply match a single dictionary entry id (e.g., open = "apps"), not a collapse panel question title or id.

Value

a shinyBS::bsCollapse object or a list.

Examples

1
#not run

leonawicz/apputils documentation built on May 13, 2019, 1:38 a.m.