Skip to main content

BlockStyle

Struct BlockStyle 

Source
pub struct BlockStyle {
    pub role: String,
    pub font_family: Option<PropertyValue>,
    pub font_size: Option<PropertyValue>,
    pub font_weight: Option<PropertyValue>,
    pub fill: Option<PropertyValue>,
    pub align: Option<String>,
    pub italic: Option<bool>,
    pub space_before: Option<Dimension>,
    pub space_after: Option<Dimension>,
}
Expand description

Style + spacing declaration for a single markdown block role.

Declared as a block role="h1" … leaf child at document, page, or text scope. All style fields are optional; absent fields fall through to the next scope in the cascade (text > page > document) and ultimately to the node-level default. An empty block decl (only role set) is valid and simply acts as a noop override.

Fields§

§role: String

The block role this decl targets (e.g. "h1", "p", "blockquote").

§font_family: Option<PropertyValue>

Override font family (token ref or literal).

§font_size: Option<PropertyValue>

Override font size (token ref, pixel literal, or dimension ref).

§font_weight: Option<PropertyValue>

Override font weight (token ref or literal).

§fill: Option<PropertyValue>

Override text fill color (token ref or literal).

§align: Option<String>

Override text alignment: "left", "center", "right", "justify".

§italic: Option<bool>

Override italic rendering.

§space_before: Option<Dimension>

Extra space inserted above the block (resolved at compile time).

§space_after: Option<Dimension>

Extra space inserted below the block (resolved at compile time).

Trait Implementations§

Source§

impl Clone for BlockStyle

Source§

fn clone(&self) -> BlockStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BlockStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BlockStyle

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for BlockStyle

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