zng_wgt_markdown

Struct Markdown

Source
pub struct Markdown(/* private fields */);
Expand description

W Render markdown styled text.

Implementations§

Source§

impl Markdown

Source

pub fn image_resolver(&self, resolver: impl IntoVar<ImageResolver>)

P 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.

Source§

impl Markdown

P Markdown link resolver.

This can be used to expand or replace links.

Sets the LINK_RESOLVER_VAR.

Source§

impl Markdown

P Scroll-to mode used by anchor links.

Source§

impl Markdown

Source

pub fn text_fn(&self, wgt_fn: impl IntoVar<WidgetFn<TextFnArgs>>)

P Widget function that converts TextFnArgs to widgets.

Sets the TEXT_FN_VAR.

Source§

impl Markdown

P Widget function that converts LinkFnArgs to widgets.

Sets the LINK_FN_VAR.

Source§

impl Markdown

Source

pub fn code_inline_fn(&self, wgt_fn: impl IntoVar<WidgetFn<CodeInlineFnArgs>>)

P Widget function that converts CodeInlineFnArgs to widgets.

Sets the CODE_INLINE_FN_VAR.

Source§

impl Markdown

Source

pub fn code_block_fn(&self, wgt_fn: impl IntoVar<WidgetFn<CodeBlockFnArgs>>)

P Widget function that converts CodeBlockFnArgs to widgets.

Sets the CODE_BLOCK_FN_VAR.

Source§

impl Markdown

Source

pub fn paragraph_fn(&self, wgt_fn: impl IntoVar<WidgetFn<ParagraphFnArgs>>)

P Widget function that converts ParagraphFnArgs to widgets.

Sets the PARAGRAPH_FN_VAR.

Source§

impl Markdown

Source

pub fn heading_fn(&self, wgt_fn: impl IntoVar<WidgetFn<HeadingFnArgs>>)

P Widget function that converts HeadingFnArgs to widgets.

Sets the HEADING_FN_VAR.

Source§

impl Markdown

Source

pub fn list_fn(&self, wgt_fn: impl IntoVar<WidgetFn<ListFnArgs>>)

P Widget function that converts ListFnArgs to widgets.

Sets the LIST_FN_VAR.

Source§

impl Markdown

Source

pub fn def_list_fn(&self, wgt_fn: impl IntoVar<WidgetFn<DefListArgs>>)

P Widget function that converts DefListArgs to widgets.

Sets the DEF_LIST_FN_VAR.

Source§

impl Markdown

Source

pub fn def_list_item_title_fn( &self, wgt_fn: impl IntoVar<WidgetFn<DefListItemTitleArgs>>, )

P Widget function that converts DefListItemTitleArgs to widgets.

Sets the DEF_LIST_ITEM_TITLE_FN_VAR.

Source§

impl Markdown

Source

pub fn def_list_item_definition_fn( &self, wgt_fn: impl IntoVar<WidgetFn<DefListItemDefinitionArgs>>, )

P Widget function that converts DefListItemDefinitionArgs to widgets.

Sets the DEF_LIST_ITEM_DEFINITION_FN_VAR.

Source§

impl Markdown

Source

pub fn list_item_bullet_fn( &self, wgt_fn: impl IntoVar<WidgetFn<ListItemBulletFnArgs>>, )

P Widget function that converts ListItemBulletFnArgs to widgets.

Sets the LIST_ITEM_BULLET_FN_VAR.

Source§

impl Markdown

Source

pub fn list_item_fn(&self, wgt_fn: impl IntoVar<WidgetFn<ListItemFnArgs>>)

P Widget function that converts ListItemFnArgs to widgets.

Sets the LIST_ITEM_FN_VAR.

Source§

impl Markdown

Source

pub fn image_fn(&self, wgt_fn: impl IntoVar<WidgetFn<ImageFnArgs>>)

P Widget function that converts ImageFnArgs to widgets.

Sets the IMAGE_FN_VAR.

Source§

impl Markdown

Source

pub fn rule_fn(&self, wgt_fn: impl IntoVar<WidgetFn<RuleFnArgs>>)

P Widget function that converts RuleFnArgs to widgets.

Sets the RULE_FN_VAR.

Source§

impl Markdown

Source

pub fn block_quote_fn(&self, wgt_fn: impl IntoVar<WidgetFn<BlockQuoteFnArgs>>)

P Widget function that converts BlockQuoteFnArgs to widgets.

Sets the BLOCK_QUOTE_FN_VAR.

Source§

impl Markdown

Source

pub fn footnote_ref_fn(&self, wgt_fn: impl IntoVar<WidgetFn<FootnoteRefFnArgs>>)

P Widget function that converts FootnoteRefFnArgs to widgets.

Sets the FOOTNOTE_REF_FN_VAR.

Source§

impl Markdown

Source

pub fn footnote_def_fn(&self, wgt_fn: impl IntoVar<WidgetFn<FootnoteDefFnArgs>>)

P Widget function that converts FootnoteDefFnArgs to widgets.

Sets the FOOTNOTE_DEF_FN_VAR.

Source§

impl Markdown

Source

pub fn table_fn(&self, wgt_fn: impl IntoVar<WidgetFn<TableFnArgs>>)

P Widget function that converts TableFnArgs to widgets.

Sets the TABLE_FN_VAR.

Source§

impl Markdown

Source

pub fn panel_fn(&self, wgt_fn: impl IntoVar<WidgetFn<PanelFnArgs>>)

P 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.

Source§

impl Markdown

Source

pub fn widget_new() -> Self

Start building a new instance.

Source

pub fn widget_type() -> WidgetType

Gets the widget type info.

Source§

impl Markdown

Source

pub fn txt(&self, txt: impl IntoVar<Txt>)

P Markdown text.

Methods from Deref<Target = FontMix<TextSpacingMix<ParagraphMix<LangMix<WidgetBase>>>>>§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

type Target = FontMix<TextSpacingMix<ParagraphMix<LangMix<WidgetBase>>>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Markdown

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T