Skip to contents

Wraps a character vector of markdown lines as a body grob using gridtext::textbox_grob(), so bold/italic/links work. Each line is laid out as its own row, one per element of md; a "- "-prefixed line gets a bullet in its own narrow column so a wrapped continuation line aligns under the item's own text rather than under the bullet (a hanging indent) – gridtext has no CSS text-indent/padding-left support to do this within a single call, so each item is measured and wrapped separately instead. Leading spaces on a line (e.g. to show nested YAML or code) are likewise stripped before markdown parsing – gridtext/ commonmark trims leading whitespace, including   – and rebuilt as a real, measured spacer column so the indent survives rendering.

Usage

card_text(md, theme = poster_theme(), width = NULL)

Arguments

md

Character vector. Each element becomes one paragraph/bullet. Markdown syntax (e.g. **bold**) is honoured. Leading spaces are rendered as indentation.

theme

A poster_theme() object.

width

Wrap width, as a grid::unit or millimetres. NULL lets the grob size to its natural width (no wrapping).

Value

A grob suitable as the body argument of poster_card().

Examples

g <- card_text(c("- point one", "- point two"), poster_theme())