renderStyle function

String renderStyle(
  1. String markdown, {
  2. required GlamourTheme theme,
  3. int width = 80,
})

Renders markdown text using the specified theme.

If width is provided, text will be wrapped to that width. Defaults to 80 columns.

Implementation

String renderStyle(
  String markdown, {
  required GlamourTheme theme,
  int width = 80,
}) {
  final nodes = markdown_backend.parseMarkdownNodes(markdown);
  final renderer = GlamourRenderer(theme: theme, width: width);
  return renderer.render(nodes);
}