MarkdownWriter

Struct MarkdownWriter 

Source
pub struct MarkdownWriter<W: Write> { /* private fields */ }
Expand description

A DocumentationWriter that generates markdown documents.

§Examples

See DocumentationWriter.

Implementations§

Source§

impl<W: Write> MarkdownWriter<W>

Source

pub fn new(w: W) -> Self

Create a new instance.

Trait Implementations§

Source§

impl<W: Write> DocumentationWriter for MarkdownWriter<W>

Source§

type Error = Error

The error type returned by this writer.
Source§

fn set_title(&mut self, title: Cow<'static, str>)

Set the title of this document. Read more
Source§

fn set_subtitle(&mut self, subtitle: Cow<'static, str>)

Set the subtitle of this document. Read more
Source§

fn set_license(&mut self, license: Cow<'static, str>)

Set the license of this man page and/or the code it covers. Read more
Source§

fn usage(&mut self, usage: &str) -> Result<(), Self::Error>

Emit usage information. Read more
Source§

fn start_description(&mut self) -> Result<(), Self::Error>

Start the description section. Read more
Source§

fn start_section(&mut self, name: &str) -> Result<(), Self::Error>

Start a custom section. Read more
Source§

fn plain(&mut self, s: &str) -> Result<(), Self::Error>

Emit unformatted text. Read more
Source§

fn paragraph_break(&mut self) -> Result<(), Self::Error>

Emit a paragraph break. Read more
Source§

fn emphasis(&mut self, text: &str) -> Result<(), Self::Error>

Emit emphasized (italicized) text. Read more
Source§

fn strong(&mut self, text: &str) -> Result<(), Self::Error>

Emit strong (bold) text. Read more
Emit a hyperlink. Read more
Source§

fn start_options(&mut self) -> Result<(), Self::Error>

Start the options section. Read more
Source§

fn option(&mut self, name: &str, default: &str) -> Result<(), Self::Error>

Emit an option. Read more
Source§

fn start_environment(&mut self) -> Result<(), Self::Error>

Start the environment section. Read more
Source§

fn variable(&mut self, name: &str, default: &str) -> Result<(), Self::Error>

Emit an environment variable. Read more
Source§

fn start_enum(&mut self, name: &str) -> Result<(), Self::Error>

Start a custom enum section. Read more
Source§

fn variant(&mut self, name: &str) -> Result<(), Self::Error>

Emit a enum variant. Read more
Source§

fn finish(self) -> Result<(), Self::Error>

Finish the document by writing a footer. Read more

Auto Trait Implementations§

§

impl<W> Freeze for MarkdownWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for MarkdownWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for MarkdownWriter<W>
where W: Send,

§

impl<W> Sync for MarkdownWriter<W>
where W: Sync,

§

impl<W> Unpin for MarkdownWriter<W>
where W: Unpin,

§

impl<W> UnwindSafe for MarkdownWriter<W>
where W: UnwindSafe,

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<D> MarkdownParseExt for D

Source§

type Error = MarkdownParseError<<D as DocumentationWriter>::Error>

Available on crate feature parse-markdown only.
This error wraps errors during markdown processing and io errors occurring during writing. Read more
Source§

fn write_markdown( &mut self, md: &str, ) -> Result<(), <D as MarkdownParseExt>::Error>

Available on crate feature parse-markdown only.
Emit events corresponding to the given markdown. 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.