Struct md_gen::md_gen::markdown::Markdown[][src]

pub struct Markdown<'a> {
    pub filename: &'a str,
    pub lines: Vec<String>,
}

Struct containing the Markdown content and the filename.

Fields

filename: &'a strlines: Vec<String>

Implementations

impl Markdown<'_>[src]

pub fn new(filename: &str) -> Markdown<'_>[src]

Create a markdown with the targeted filename.

pub fn write(&mut self) -> Result<(), Error>[src]

Create the destination path, adds a final blank line and writes the file.

pub fn add_text(&mut self, text: &str)[src]

Adds a text line (free formatting).

pub fn add_main_heading(&mut self, title: &str)[src]

Adds a main heading (#).

pub fn add_lvl1_heading(&mut self, title: &str)[src]

Adds a level 1 heading (##).

pub fn add_lvl2_heading(&mut self, title: &str)[src]

Adds a level 2 heading (###).

pub fn add_lvl3_heading(&mut self, title: &str)[src]

Adds a level 3 heading (####).

pub fn add_unordered_list(&mut self, list: Vec<&str>)[src]

Adds an unordered list (- ) from a list.

pub fn add_blockquoted_unordered_list(&mut self, list: Vec<&str>)[src]

Adds a blockquoted unordered list (> - ) from a list.

pub fn add_ordered_list(&mut self, list: Vec<&str>)[src]

Adds an ordered list (- ) from a list.

pub fn add_simple_code(&mut self, code: &str)[src]

Adds a simple code (code).

pub fn add_specific_code(&mut self, language: &str, code: &str)[src]

Adds a multiline code with specific language.

pub fn add_multilines_code(&mut self, code: &str)[src]

Adds a multilines code.

pub fn add_horizontal_rule(&mut self)[src]

Adds an horizontal rule (—).

Adds a link with a title.

pub fn add_image(&mut self, image: &str, alt_text: &str)[src]

Adds an image with an alt text.

pub fn add_table_headers(&mut self, headers: Vec<&str>)[src]

Adds table headers (headers + — cells) from a vector of headers.

pub fn add_table_row(&mut self, cells: Vec<&str>)[src]

Adds a table row from a vector of cells.

pub fn add_blank_line(&mut self)[src]

Adds a blank line.

pub fn add_blockquote(&mut self, blockquote: &str)[src]

Adds a blockquote. The blockquote can be multiline while no double \n is met.

pub fn add_definition(&mut self, terme: &str, definition: &str)[src]

Adds a definition.

pub fn add_meta_data(&mut self, meta: Metadata<'_>)[src]

Adds predefined Vuepress compatible metadatas. Must be call before composing the doc.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Markdown<'a>

impl<'a> Send for Markdown<'a>

impl<'a> Sync for Markdown<'a>

impl<'a> Unpin for Markdown<'a>

impl<'a> UnwindSafe for Markdown<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.