Learn R Programming

Kmisc (version 0.1.0)

makeHTMLTag: Make HTML Elements

Description

Creates a function that returns a function that can be used to generate HTML elements. See examples for usage.

Usage

makeHTMLTag(tag, ...)

Arguments

tag
the HTML tag to use
...
a collection of named and unnamed arguments; named arguments are parsed as attributes of the tag, unnamed arguments are pasted together into the inner data of the tag.

Details

This function returns a function that can be called as an HTML tag generating function. For example, by calling p <- makeHTMLTag("p"), we can generate a function that interprets all named arguments as attributes, and all unnamed arguments as 'data'. This is primarily used behind the scenes to generate all the HTML tagging functions in html. Note that this function assumes the presence of the html environment, which is where HTML function declarations live.

See Also

html