pub struct MarkdownStyle {Show 39 fields
pub h1_icon: &'static str,
pub h2_icon: &'static str,
pub h3_icon: &'static str,
pub h4_icon: &'static str,
pub h5_icon: &'static str,
pub h6_icon: &'static str,
pub h1_fg: Color,
pub h1_bg: Color,
pub h2_fg: Color,
pub h2_bg: Color,
pub h3_fg: Color,
pub h3_bg: Color,
pub h4_fg: Color,
pub h4_bg: Color,
pub h5_fg: Color,
pub h5_bg: Color,
pub h6_fg: Color,
pub h6_bg: Color,
pub bullet_l1: &'static str,
pub bullet_l2: &'static str,
pub bullet_l3: &'static str,
pub code_block_border: bool,
pub code_block_bg: Color,
pub inline_code_bg: Color,
pub inline_code_fg: Color,
pub quote_icon: &'static str,
pub quote_fg: Color,
pub quote_bg: Color,
pub callout_note_icon: &'static str,
pub callout_tip_icon: &'static str,
pub callout_warning_icon: &'static str,
pub callout_caution_icon: &'static str,
pub text_fg: Color,
pub text_bg: Color,
pub link_fg: Color,
pub emph_fg: Color,
pub strong_fg: Color,
pub hr_fg: Color,
pub table_border_fg: Color,
}markdown-preview only.Expand description
Configuration for markdown rendering styles.
This module provides the MarkdownStyle struct which configures
the visual appearance of markdown elements including headings,
code blocks, lists, and more.
Configuration for markdown rendering styles.
This struct allows customization of all visual aspects of markdown rendering, including heading icons and colors, bullet point styles, code block appearance, and text colors.
§Example
use ratatui_toolkit::markdown_widget::extensions::theme::MarkdownStyle;
// Use default styling
let style = MarkdownStyle::default();Fields§
§h1_icon: &'static strIcon displayed before H1 headings (e.g., “* “).
h2_icon: &'static strIcon displayed before H2 headings (e.g., “* “).
h3_icon: &'static strIcon displayed before H3 headings (e.g., “* “).
h4_icon: &'static strIcon displayed before H4 headings (e.g., “* “).
h5_icon: &'static strIcon displayed before H5 headings (e.g., “* “).
h6_icon: &'static strIcon displayed before H6 headings (e.g., “* “).
h1_fg: ColorForeground color for H1 headings.
h1_bg: ColorBackground color for H1 headings.
h2_fg: ColorForeground color for H2 headings.
h2_bg: ColorBackground color for H2 headings.
h3_fg: ColorForeground color for H3 headings.
h3_bg: ColorBackground color for H3 headings.
h4_fg: ColorForeground color for H4 headings.
h4_bg: ColorBackground color for H4 headings.
h5_fg: ColorForeground color for H5 headings.
h5_bg: ColorBackground color for H5 headings.
h6_fg: ColorForeground color for H6 headings.
h6_bg: ColorBackground color for H6 headings.
bullet_l1: &'static strBullet character for level 1 list items (e.g., “* “).
bullet_l2: &'static strBullet character for level 2 list items (e.g., “* “).
bullet_l3: &'static strBullet character for level 3 list items (e.g., “* “).
code_block_border: boolWhether to show a border around code blocks.
code_block_bg: ColorBackground color for code blocks.
inline_code_bg: ColorBackground color for inline code spans.
inline_code_fg: ColorForeground color for inline code spans.
quote_icon: &'static strIcon displayed at the start of blockquotes (e.g., “| “).
quote_fg: ColorForeground color for blockquote text.
quote_bg: ColorBackground color for blockquotes.
callout_note_icon: &'static strIcon for note callouts (e.g., “! “).
callout_tip_icon: &'static strIcon for tip callouts (e.g., “! “).
callout_warning_icon: &'static strIcon for warning callouts (e.g., “! “).
callout_caution_icon: &'static strIcon for caution callouts (e.g., “! “).
text_fg: ColorDefault foreground color for body text.
text_bg: ColorDefault background color for body text.
link_fg: ColorForeground color for hyperlinks.
emph_fg: ColorForeground color for emphasized (italic) text.
strong_fg: ColorForeground color for strong (bold) text.
hr_fg: ColorForeground color for horizontal rules.
table_border_fg: ColorForeground color for table borders.
Trait Implementations§
Source§impl Clone for MarkdownStyle
impl Clone for MarkdownStyle
Source§fn clone(&self) -> MarkdownStyle
fn clone(&self) -> MarkdownStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MarkdownStyle
Default trait implementation for MarkdownStyle.
impl Default for MarkdownStyle
Default trait implementation for MarkdownStyle.
Source§fn default() -> MarkdownStyle
fn default() -> MarkdownStyle
Auto Trait Implementations§
impl Freeze for MarkdownStyle
impl RefUnwindSafe for MarkdownStyle
impl Send for MarkdownStyle
impl Sync for MarkdownStyle
impl Unpin for MarkdownStyle
impl UnsafeUnpin for MarkdownStyle
impl UnwindSafe for MarkdownStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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