MarkdownBuilder

Struct MarkdownBuilder 

Source
pub struct MarkdownBuilder { /* private fields */ }
Expand description

Builder pattern for creating test content with common markdown patterns

Implementations§

Source§

impl MarkdownBuilder

Source

pub fn new() -> Self

Source

pub fn heading(self, level: usize, text: &str) -> Self

Source

pub fn paragraph(self, text: &str) -> Self

Source

pub fn blank_line(self) -> Self

Source

pub fn code_block(self, language: &str, code: &str) -> Self

Source

pub fn unordered_list(self, items: &[&str]) -> Self

Source

pub fn ordered_list(self, items: &[&str]) -> Self

Source

pub fn line(self, text: &str) -> Self

Source

pub fn blockquote(self, text: &str) -> Self

Source

pub fn table(self, headers: &[&str], rows: &[Vec<&str>]) -> Self

Source

pub fn image(self, alt_text: &str, url: &str) -> Self

Source

pub fn horizontal_rule(self) -> Self

Source

pub fn inline_code(self, text: &str, code: &str) -> Self

Source

pub fn emphasis(self, text: &str) -> Self

Source

pub fn strong(self, text: &str) -> Self

Source

pub fn strikethrough(self, text: &str) -> Self

Source

pub fn footnote_definition(self, label: &str, content: &str) -> Self

Source

pub fn footnote_reference(self, text: &str, label: &str) -> Self

Source

pub fn task_list(self, items: &[(&str, bool)]) -> Self

Source

pub fn nested_list(self, items: &[(&str, Option<Vec<&str>>)]) -> Self

Source

pub fn definition_list(self, definitions: &[(&str, &str)]) -> Self

Source

pub fn math_block(self, formula: &str) -> Self

Source

pub fn inline_math(self, text: &str, formula: &str) -> Self

Source

pub fn build(self) -> String

Trait Implementations§

Source§

impl Default for MarkdownBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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