[][src]Struct md2src::MD2Src

pub struct MD2Src {}

Markdown to source code

Implementations

impl MD2Src[src]

pub fn get_snippets_from_string(
    &self,
    markdown: String,
    lang: String,
    ignore: String
) -> Result<Vec<String>, ExitFailure>
[src]

Returns a vector of extracted code snippets.

Arguments

  • markdown - The markdown string
  • lang - The language of the code snippets defined after three backticks
  • ignore - Ignore those code snippets that include this string

pub fn get_snippets_from_file(
    &self,
    file: String,
    lang: String,
    ignore: String
) -> Result<Vec<String>, ExitFailure>
[src]

Returns a vector of extracted code snippets.

Arguments

  • file - The markdown filename
  • lang - The language of the code snippets defined after three backticks
  • ignore - Ignore those code snippets that include this string

pub fn write_snippets(
    &self,
    snippets: Vec<String>,
    folder: String,
    prefix: String,
    ext: String
) -> Result<(), ExitFailure>
[src]

Writes a vector of extracted code snippets (each snippet one file: folder/prefix000.ext).

Arguments

  • snippets - The extracted code snippets.
  • folder - The target folder for the code files.
  • prefix - The prefix of the code files.
  • ext - The extension of the code files.

Auto Trait Implementations

impl RefUnwindSafe for MD2Src

impl Send for MD2Src

impl Sync for MD2Src

impl Unpin for MD2Src

impl UnwindSafe for MD2Src

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.