Skip to main content

Crate waft_markdown

Crate waft_markdown 

Source
Expand description

Markdown widgets for Waft, with flutter_markdown’s API ideas and look.

parse turns Markdown into a typed document of Blocks and Inlines with pulldown-cmark; MarkdownBody and Markdown keep that document and render it, in the look of the inherited DefaultMarkdownStyle or their own MarkdownStyleSheet. Each element renders as its function in render does unless the widget has a hook for it.

Re-exports§

pub use render::Bullet;

Modules§

render
The default rendering of a document into widgets, one public function per element, so a renderer that replaces some elements can fall back on these for the rest.

Structs§

BlockStyle
How a block drawn in a box looks: a quote or a code block.
Cell
A cell of a Block::Table.
DefaultMarkdownStyle
The MarkdownStyleSheet of the Markdown widgets below it that are given none of their own; a kit or an app sets it, as DefaultTextStyle sets text’s style.
HeadingStyle
How a heading looks.
Image
An image, as the document wrote it.
ListItem
An item of a Block::List.
ListStyle
How a list looks.
Markdown
Markdown in a scrolling list, one block per item.
MarkdownBody
Markdown laid out in a column, for a parent that scrolls or sizes it.
MarkdownConfig
What MarkdownBody and Markdown share: the text, how it is parsed, how it looks.
MarkdownHooks
The closures that replace parts of the default rendering; an element without one renders as the render module’s function for it does.
MarkdownStyleSheet
How each element of a Markdown document looks.
Options
Option struct containing flags for enabling extra features that are not part of the CommonMark spec.
TableStyle
How a table looks.

Enums§

Alignment
Table column text alignment.
Block
A block of a document.
Inline
A run of text inside a block.

Constants§

GITHUB_FLAVORED
The extensions a document is parsed with unless a widget asks for others: GitHub’s tables, strikethrough and task lists.

Functions§

parse
The blocks of markdown, parsed by pulldown-cmark with options.

Type Aliases§

BulletHook
Builds a list item’s bullet.
CheckboxHook
Builds a task item’s checkbox from whether it is ticked.
HighlightCodeHook
Builds the spans of a code block’s text from its language.
ImageHook
Builds the widget of an image.
TapLinkHook
Called with a tapped link’s address and title.