Render HTML or Markdown. The function html_grob() returns a grid grob that can be drawn with grid.draw(), and the function draw_html() renders the HTML directly to the current graphics device.

html_grob(
  text,
  x = unit(0.05, "npc"),
  y = unit(0.95, "npc"),
  width = unit(0.9, "npc"),
  height = NULL,
  hjust = 0,
  vjust = 1,
  css = "",
  default.units = "npc",
  vp = NULL
)

draw_html(..., newpage = TRUE)

Arguments

text

HTML or Markdown text to render

x, y

x and y position

width, height

Width and height. A value of NULL means take up the available space as needed.

hjust, vjust

horizontal and vertical justification relative to x and y

css

CSS specification to use for rendering

default.units

Units of x, y, width, height if these are provided only as numerical values.

vp

viewport

...

Parameters forwarded to html_grob().

newpage

Logical indicating whether grid.newpage() should be called before drawing.

Value

html_grob(): A grid grob representing the rendered html text.

draw_html(): Nothing. The function is only called for its side effects.