pub struct Markdown(/* private fields */);
Expand description
W
Render markdown styled text.
Properties§
Sourcepub image_resolver(resolver: impl IntoVar<ImageResolver>);
pub image_resolver(resolver: impl IntoVar<ImageResolver>);
Markdown image resolver.
This can be used to override image source resolution, by default the image URL or URI is passed as parsed to the image_fn
.
Note that image downloads are blocked by default, you can enable this by using the image::img_limits
property.
Sets the IMAGE_RESOLVER_VAR
.
Sourcepub link_resolver(resolver: impl IntoVar<LinkResolver>);
pub link_resolver(resolver: impl IntoVar<LinkResolver>);
Sourcepub link_scroll_mode(mode: impl IntoVar<ScrollToMode>);
pub link_scroll_mode(mode: impl IntoVar<ScrollToMode>);
Scroll-to mode used by anchor links.
Sourcepub text_fn(wgt_fn: impl IntoVar<WidgetFn<TextFnArgs>>);
pub text_fn(wgt_fn: impl IntoVar<WidgetFn<TextFnArgs>>);
Widget function that converts TextFnArgs
to widgets.
Sets the TEXT_FN_VAR
.
Sourcepub link_fn(wgt_fn: impl IntoVar<WidgetFn<LinkFnArgs>>);
pub link_fn(wgt_fn: impl IntoVar<WidgetFn<LinkFnArgs>>);
Widget function that converts LinkFnArgs
to widgets.
Sets the LINK_FN_VAR
.
Sourcepub code_inline_fn(wgt_fn: impl IntoVar<WidgetFn<CodeInlineFnArgs>>);
pub code_inline_fn(wgt_fn: impl IntoVar<WidgetFn<CodeInlineFnArgs>>);
Widget function that converts CodeInlineFnArgs
to widgets.
Sets the CODE_INLINE_FN_VAR
.
Sourcepub code_block_fn(wgt_fn: impl IntoVar<WidgetFn<CodeBlockFnArgs>>);
pub code_block_fn(wgt_fn: impl IntoVar<WidgetFn<CodeBlockFnArgs>>);
Widget function that converts CodeBlockFnArgs
to widgets.
Sets the CODE_BLOCK_FN_VAR
.
Sourcepub paragraph_fn(wgt_fn: impl IntoVar<WidgetFn<ParagraphFnArgs>>);
pub paragraph_fn(wgt_fn: impl IntoVar<WidgetFn<ParagraphFnArgs>>);
Widget function that converts ParagraphFnArgs
to widgets.
Sets the PARAGRAPH_FN_VAR
.
Sourcepub heading_fn(wgt_fn: impl IntoVar<WidgetFn<HeadingFnArgs>>);
pub heading_fn(wgt_fn: impl IntoVar<WidgetFn<HeadingFnArgs>>);
Widget function that converts HeadingFnArgs
to widgets.
Sets the HEADING_FN_VAR
.
Sourcepub list_fn(wgt_fn: impl IntoVar<WidgetFn<ListFnArgs>>);
pub list_fn(wgt_fn: impl IntoVar<WidgetFn<ListFnArgs>>);
Widget function that converts ListFnArgs
to widgets.
Sets the LIST_FN_VAR
.
Sourcepub def_list_fn(wgt_fn: impl IntoVar<WidgetFn<DefListArgs>>);
pub def_list_fn(wgt_fn: impl IntoVar<WidgetFn<DefListArgs>>);
Widget function that converts DefListArgs
to widgets.
Sets the DEF_LIST_FN_VAR
.
Sourcepub def_list_item_title_fn(
&self,
wgt_fn: impl IntoVar<WidgetFn<DefListItemTitleArgs>>,
);
pub def_list_item_title_fn( &self, wgt_fn: impl IntoVar<WidgetFn<DefListItemTitleArgs>>, );
Widget function that converts DefListItemTitleArgs
to widgets.
Sets the DEF_LIST_ITEM_TITLE_FN_VAR
.
Sourcepub def_list_item_definition_fn(
&self,
wgt_fn: impl IntoVar<WidgetFn<DefListItemDefinitionArgs>>,
);
pub def_list_item_definition_fn( &self, wgt_fn: impl IntoVar<WidgetFn<DefListItemDefinitionArgs>>, );
Widget function that converts DefListItemDefinitionArgs
to widgets.
Sets the DEF_LIST_ITEM_DEFINITION_FN_VAR
.
Sourcepub list_item_bullet_fn(
&self,
wgt_fn: impl IntoVar<WidgetFn<ListItemBulletFnArgs>>,
);
pub list_item_bullet_fn( &self, wgt_fn: impl IntoVar<WidgetFn<ListItemBulletFnArgs>>, );
Widget function that converts ListItemBulletFnArgs
to widgets.
Sets the LIST_ITEM_BULLET_FN_VAR
.
Sourcepub list_item_fn(wgt_fn: impl IntoVar<WidgetFn<ListItemFnArgs>>);
pub list_item_fn(wgt_fn: impl IntoVar<WidgetFn<ListItemFnArgs>>);
Widget function that converts ListItemFnArgs
to widgets.
Sets the LIST_ITEM_FN_VAR
.
Sourcepub image_fn(wgt_fn: impl IntoVar<WidgetFn<ImageFnArgs>>);
pub image_fn(wgt_fn: impl IntoVar<WidgetFn<ImageFnArgs>>);
Widget function that converts ImageFnArgs
to widgets.
Sets the IMAGE_FN_VAR
.
Sourcepub rule_fn(wgt_fn: impl IntoVar<WidgetFn<RuleFnArgs>>);
pub rule_fn(wgt_fn: impl IntoVar<WidgetFn<RuleFnArgs>>);
Widget function that converts RuleFnArgs
to widgets.
Sets the RULE_FN_VAR
.
Sourcepub block_quote_fn(wgt_fn: impl IntoVar<WidgetFn<BlockQuoteFnArgs>>);
pub block_quote_fn(wgt_fn: impl IntoVar<WidgetFn<BlockQuoteFnArgs>>);
Widget function that converts BlockQuoteFnArgs
to widgets.
Sets the BLOCK_QUOTE_FN_VAR
.
Sourcepub footnote_ref_fn(wgt_fn: impl IntoVar<WidgetFn<FootnoteRefFnArgs>>);
pub footnote_ref_fn(wgt_fn: impl IntoVar<WidgetFn<FootnoteRefFnArgs>>);
Widget function that converts FootnoteRefFnArgs
to widgets.
Sets the FOOTNOTE_REF_FN_VAR
.
Sourcepub footnote_def_fn(wgt_fn: impl IntoVar<WidgetFn<FootnoteDefFnArgs>>);
pub footnote_def_fn(wgt_fn: impl IntoVar<WidgetFn<FootnoteDefFnArgs>>);
Widget function that converts FootnoteDefFnArgs
to widgets.
Sets the FOOTNOTE_DEF_FN_VAR
.
Sourcepub table_fn(wgt_fn: impl IntoVar<WidgetFn<TableFnArgs>>);
pub table_fn(wgt_fn: impl IntoVar<WidgetFn<TableFnArgs>>);
Widget function that converts TableFnArgs
to widgets.
Sets the TABLE_FN_VAR
.
Sourcepub panel_fn(wgt_fn: impl IntoVar<WidgetFn<PanelFnArgs>>);
pub panel_fn(wgt_fn: impl IntoVar<WidgetFn<PanelFnArgs>>);
Widget function that converts PanelFnArgs
to a widget.
This generates the panel that contains all markdown blocks, it is the child of the Markdown!
widget.
Sets the PANEL_FN_VAR
.
Properties from FontMix§
Implementations§
Source§impl Markdown
impl Markdown
Sourcepub fn widget_new() -> Self
pub fn widget_new() -> Self
Start building a new instance.
Sourcepub fn widget_type() -> WidgetType
pub fn widget_type() -> WidgetType
Gets the widget type info.
Inherits from ParagraphMix
Inherits from LangMix
Inherits from WidgetBase
Sourcepub fn font_family(&self, names: impl IntoVar<FontNames>)
pub fn font_family(&self, names: impl IntoVar<FontNames>)
P
Font family name or list of names for texts in this widget or descendants.
All fonts in the list are resolved according to the font_style
, font_weight
and font_stretch
config.
During text shaping the first font on the list is preferred, but if the font does not cover a character or word, that
character or word to the second font in the list and so on.
Sets the FONT_FAMILY_VAR
.
Sourcepub fn font_size(&self, size: impl IntoVar<Length>)
pub fn font_size(&self, size: impl IntoVar<Length>)
P
Sets the font size for the widget and descendants.
This property affects all texts inside the widget and the Length::Em
unit.
Sets the FONT_SIZE_VAR
context var and the LayoutMetrics::font_size
.
Sourcepub fn font_weight(&self, weight: impl IntoVar<FontWeight>)
pub fn font_weight(&self, weight: impl IntoVar<FontWeight>)
P
Defines the thickness or boldness the preferred font should have.
This value influences font resolution, the variant within the font family that is closest to this config will be selected.
Sets the FONT_WEIGHT_VAR
.
Sourcepub fn font_style(&self, style: impl IntoVar<FontStyle>)
pub fn font_style(&self, style: impl IntoVar<FontStyle>)
P
Defines the skew style of the font glyphs.
This value influences font resolution, the variant within the font family that is closest to this config will be selected.
Sets the FONT_STYLE_VAR
.
Sourcepub fn font_stretch(&self, stretch: impl IntoVar<FontStretch>)
pub fn font_stretch(&self, stretch: impl IntoVar<FontStretch>)
P
Defines how condensed or expanded the preferred font should be.
This value influences font resolution, the variant within the font family that is closest to this config will be selected.
Sets the FONT_STRETCH_VAR
.
Sourcepub fn font_synthesis(&self, enabled: impl IntoVar<FontSynthesis>)
pub fn font_synthesis(&self, enabled: impl IntoVar<FontSynthesis>)
P
Configure if a synthetic font is generated for fonts that do not implement bold or oblique variants.
Not all fonts implement the requested font_weight
and font_style
, this config allows the renderer
to try and generate the style and weight anyway, using transforms and the glyph outlines.
Sets the FONT_SYNTHESIS_VAR
.
Sourcepub fn font_aa(&self, aa: impl IntoVar<FontAntiAliasing>)
pub fn font_aa(&self, aa: impl IntoVar<FontAntiAliasing>)
P
Configure the anti-aliasing used to render text glyphs inside the widget.
Uses the operating system configuration by default.
Sets the FONT_AA_VAR
.
Trait Implementations§
Source§impl Deref for Markdown
impl Deref for Markdown
Source§type Target = FontMix<TextSpacingMix<ParagraphMix<LangMix<WidgetBase>>>>
type Target = FontMix<TextSpacingMix<ParagraphMix<LangMix<WidgetBase>>>>
Auto Trait Implementations§
impl !Freeze for Markdown
impl !RefUnwindSafe for Markdown
impl Send for Markdown
impl !Sync for Markdown
impl Unpin for Markdown
impl !UnwindSafe for Markdown
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more