pub struct Doc(Vec<Box<str>>);Expand description
Builder for multi-line markdown documents.
Tuple Fields§
§0: Vec<Box<str>>Implementations§
Source§impl Doc
impl Doc
pub fn new() -> Self
pub fn line(self, text: &str) -> Self
pub fn blank(self) -> Self
pub fn heading(self, level: u8, text: &str) -> Self
pub fn h1(self, text: &str) -> Self
pub fn h2(self, text: &str) -> Self
pub fn h3(self, text: &str) -> Self
pub fn numbered(self, n: usize, text: &str) -> Self
pub fn bullet(self, text: &str) -> Self
Sourcepub fn kv_bullet(self, key: &str, value: &str) -> Self
pub fn kv_bullet(self, key: &str, value: &str) -> Self
Render a bullet with a bold key and plain value: - **key:** value.
Sourcepub fn def(self, term: &str, desc: &str) -> Self
pub fn def(self, term: &str, desc: &str) -> Self
Render a bullet with an inline-code term and description: - `term` — desc.
Sourcepub fn def_detail(self, term: &str, detail: &str, desc: &str) -> Self
pub fn def_detail(self, term: &str, detail: &str, desc: &str) -> Self
Render - `term` (detail) — desc.
pub fn code_block(self, language: &str, content: &str) -> Self
pub fn raw(self, text: String) -> Self
pub fn build(self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Doc
impl RefUnwindSafe for Doc
impl Send for Doc
impl Sync for Doc
impl Unpin for Doc
impl UnsafeUnpin for Doc
impl UnwindSafe for Doc
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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