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§
- Block
Style - How a block drawn in a box looks: a quote or a code block.
- Cell
- A cell of a
Block::Table. - Default
Markdown Style - The
MarkdownStyleSheetof the Markdown widgets below it that are given none of their own; a kit or an app sets it, asDefaultTextStylesets text’s style. - Heading
Style - How a heading looks.
- Image
- An image, as the document wrote it.
- List
Item - An item of a
Block::List. - List
Style - How a list looks.
- Markdown
- Markdown in a scrolling list, one block per item.
- Markdown
Body - Markdown laid out in a column, for a parent that scrolls or sizes it.
- Markdown
Config - What
MarkdownBodyandMarkdownshare: the text, how it is parsed, how it looks. - Markdown
Hooks - The closures that replace parts of the default rendering; an element without one renders as
the
rendermodule’s function for it does. - Markdown
Style Sheet - 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.
- Table
Style - How a table looks.
Enums§
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 withoptions.
Type Aliases§
- Bullet
Hook - Builds a list item’s bullet.
- Checkbox
Hook - Builds a task item’s checkbox from whether it is ticked.
- Highlight
Code Hook - Builds the spans of a code block’s text from its language.
- Image
Hook - Builds the widget of an image.
- TapLink
Hook - Called with a tapped link’s address and title.