Props

Struct Props 

Source
pub struct Props {
    pub src: AttrValue,
    pub onclick: Option<Callback<MarkdownMouseEvent, ()>>,
    pub render_links: Option<Callback<LinkDescription<Html>, Html>>,
    pub theme: Option<&'static str>,
    pub wikilinks: bool,
    pub hard_line_breaks: bool,
    pub parse_options: Option<Options>,
    pub components: CustomComponents,
    pub frontmatter: Option<UseStateHandle<String>>,
    pub send_debug_info: Option<Callback<Vec<String>>>,
}

Fields§

§src: AttrValue§onclick: Option<Callback<MarkdownMouseEvent, ()>>§render_links: Option<Callback<LinkDescription<Html>, Html>>§theme: Option<&'static str>§wikilinks: bool§hard_line_breaks: bool§parse_options: Option<Options>§components: CustomComponents§frontmatter: Option<UseStateHandle<String>>§send_debug_info: Option<Callback<Vec<String>>>

Trait Implementations§

Source§

impl Clone for Props

Source§

fn clone(&self) -> Props

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Context<'a, 'static> for &'a Props

Source§

type View = VNode

Source§

type Handler<T: 'static> = Callback<T>

Source§

type MouseEvent = MouseEvent

Source§

fn props(self) -> MarkdownProps

get all the properties from the context
Source§

fn el_with_attributes( self, e: HtmlElement, inside: Self::View, attributes: ElementAttributes<Callback<MouseEvent>>, ) -> Self::View

creates a html element attributes contains the html attributes for this element
Source§

fn el_span_with_inner_html( self, inner_html: String, attributes: ElementAttributes<Callback<MouseEvent>>, ) -> Self::View

renders raw html, inside a span
Source§

fn el_hr( self, attributes: ElementAttributes<Callback<MouseEvent>>, ) -> Self::View

renders a hr element, with attributes
Source§

fn el_br(self) -> Self::View

renders a br element
Source§

fn el_fragment(self, children: Vec<Self::View>) -> Self::View

takes a vector of views and return a view
Source§

fn el_a(self, children: Self::View, href: String) -> Self::View

renders a link
Source§

fn el_img(self, src: String, alt: String) -> Self::View

renders an image
Source§

fn el_text(self, text: CowStr<'a>) -> Self::View

renders raw text
add a styleshit to the markdown component
Source§

fn el_input_checkbox( self, checked: bool, attributes: ElementAttributes<Callback<MouseEvent>>, ) -> Self::View

Source§

fn call_handler<T: 'static>(callback: &Self::Handler<T>, input: T)

calls a callback with the given input
Source§

fn make_md_handler( self, position: Range<usize>, stop_propagation: bool, ) -> Self::Handler<MouseEvent>

creates a callback that will fire when the user clicks on markdown
Source§

fn set_frontmatter(&mut self, frontmatter: String)

write the frontmatter (or metadata) string present at the top of the markdown source
Source§

fn has_custom_component(self, name: &str) -> bool

Source§

fn render_custom_component( self, name: &str, input: MdComponentProps, ) -> Result<Self::View, ComponentCreationError>

Source§

fn el(self, e: HtmlElement, inside: Self::View) -> Self::View

creates a html element, with default attributes
Source§

fn el_empty(self) -> Self::View

renders an empty view
Source§

fn render_tasklist_marker(self, m: bool, position: Range<usize>) -> Self::View

Source§

fn render_rule(self, range: Range<usize>) -> Self::View

Source§

fn render_code(self, s: CowStr<'a>, range: Range<usize>) -> Self::View

Source§

fn render_text(self, s: CowStr<'a>, range: Range<usize>) -> Self::View

Source§

impl PartialEq for Props

Source§

fn eq(&self, other: &Props) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Properties for Props

Source§

type Builder = PropsBuilder

Builder that will be used to construct properties
Source§

fn builder() -> Self::Builder

Entrypoint for building properties
Source§

impl StructuralPartialEq for Props

Auto Trait Implementations§

§

impl Freeze for Props

§

impl !RefUnwindSafe for Props

§

impl !Send for Props

§

impl !Sync for Props

§

impl Unpin for Props

§

impl !UnwindSafe for Props

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

Source§

impl<T> HasAllProps<(), T> for T