pub struct MdTheme {
pub base: Style,
pub heading: Style,
pub strong: Style,
pub emphasis: Style,
pub code: Style,
pub code_block: Style,
pub code_border: Style,
pub quote: Style,
pub bullet: Style,
pub link: Style,
pub rule: Style,
/* private fields */
}Expand description
Styles used by the Markdown renderer.
Fields§
§base: StyleOrdinary prose.
heading: StyleHeading text.
strong: StyleStrong inline text.
emphasis: StyleEmphasized inline text.
code: StyleInline code spans.
code_block: StyleCode block text.
code_border: StyleCode block fences.
quote: StyleBlockquote rails and text.
bullet: StyleOrdered and unordered list markers.
link: StyleLink labels.
rule: StyleHorizontal rules.
Implementations§
Source§impl MdTheme
impl MdTheme
Sourcepub const fn from_theme(theme: &Theme) -> Self
pub const fn from_theme(theme: &Theme) -> Self
Derives Markdown styles from the shared semantic theme.
Sourcepub const fn from_context(context: &UiContext) -> Self
pub const fn from_context(context: &UiContext) -> Self
Derives Markdown styles and diagram glyphs from the presentation context.
Sourcepub fn cascade(self, style: Style) -> Self
pub fn cascade(self, style: Style) -> Self
Folds a node’s cascaded style into the palette: prose-family
entries (base, strong, emphasis, code_block) adopt its
foreground, every entry picks up its attribute flags, and semantic
hues (headings, links, inline code, bullets) stay their own.
Syntax-highlight token colors are a deliberate boundary and keep
their palette untouched.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MdTheme
impl RefUnwindSafe for MdTheme
impl Send for MdTheme
impl Sync for MdTheme
impl Unpin for MdTheme
impl UnsafeUnpin for MdTheme
impl UnwindSafe for MdTheme
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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 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> ⓘ
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