Skip to main content

markdown_to_styled

Function markdown_to_styled 

Source
pub fn markdown_to_styled(md: &str, style: DocStyle) -> StyledText
Expand description

Parse markdown into a styled document: the inline grammar (crate::markdown) plus the block constructs a document editor needs: ATX headings, > quotes, and -/1. lists.

Headings become a run (bold at the level-dependent heading scale) rather than a paragraph attribute, because a heading is a size and a weight, and Day’s paragraph attributes are alignment, indent and list decoration. Quotes and list items become paragraph runs, which is what they are.

Day API ↩ Guides· daybrite.dev