pub trait MarkdownParseExt {
type Error: Error;
// Required method
fn write_markdown(&mut self, md: &str) -> Result<(), Self::Error>;
}
Available on crate feature
parse-markdown
only.Expand description
Contributes the write_markdown
function to DocumentationWriter
s.
Required Associated Types§
Sourcetype Error: Error
type Error: Error
This error wraps errors during markdown processing and io errors occurring during writing.
For all the standard DocumentationWriter
s it is MarkdownParseError<io::Error>
.
Required Methods§
Sourcefn write_markdown(&mut self, md: &str) -> Result<(), Self::Error>
fn write_markdown(&mut self, md: &str) -> Result<(), Self::Error>
Emit events corresponding to the given markdown.
§Examples
w.start_description()?;
w.write_markdown("*See also* <man:pcresyntax(3)>")?;
// equivalent to calling
w.emphasis("See also")?;
w.plain(" ")?;
w.link("", "man:pcresyntax(3)")?;
// this works on all writers.