Description Usage Arguments Details Value Author(s)
These functions can be used to define a backend that is used to perform HTML layout.
1 2 3 4 5 6 7 8 9 10 | makeEngine(layout, cssTransform=list())
makeLayout(type, name, x, y, width, height, baseline, text, family,
bold, italic, size, color, direction, backgroundColor, borderLeftWidth,
borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftStyle,
borderTopStyle, borderRightStyle, borderBottomStyle, borderLeftColor,
borderTopColor, borderRightColor, borderBottomColor,
listStyleType, listStylePosition)
copyAssets(html, dir)
fontFiles(fonts, device)
layoutFields
|
layout |
A function that performs HTML layout and returns the result
(which should be the result of calling |
cssTransform |
A list of (optional) functions that a backend
can define for transforming CSS properties. Currently used
components are |
type, name, x, y, width, height, baseline, text, family,
bold, italic, size, color, direction, backgroundColor, borderLeftWidth,
borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftStyle,
borderTopStyle, borderRightStyle, borderBottomStyle, borderLeftColor,
borderTopColor, borderRightColor, borderBottomColor,
listStyleType, listStylePosition |
Each argument represents a field that the layout result should
return for each node in the HTML content.
The type, name, location and size fields must be present, but
most other fields can be |
html |
A |
dir |
A directory to copy asset files to. |
fonts |
A character vector containing R font family names. |
device |
The name of the device that will be used to render the layout. |
The makeEngine
function should be used to create a backend
for the layoutEngine package. This function should be supplied
a function that accepts arguments html
, width
,
height
, fonts
, and
device
, where html
is an "htmlDocument"
object
(as produced by htmlDocument
or
htmlElement
), width
and height
are
the width and height that should be used to layout the HTML (in inches),
and the other arguments are as described on this page. The function
should return a "flowedhtml"
object (as produced by
"makeLayout"
).
The remainder of the
functions are helper functions for use in the main backend function:
copyAssets
to copy assets to a useful place; fontFiles
to locate font files (probably to copy them as well); and
makeLayout
to create the result of the layout.
The layoutFields
object is useful for providing the names
of the columns in the layout result.
makeEngine
produces a "layoutengine"
object.
makeLayout
produces a "flowedhtml"
object. At present
this is just a data frame, but longer term something more hierarchical
is probably going to be better.
Paul Murrell
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.