pub struct MD2Src;Expand description
Markdown to source code
Implementations§
Source§impl MD2Src
impl MD2Src
Sourcepub fn get_snippets_from_string(
&self,
markdown: String,
lang: String,
ignore: Vec<String>,
) -> Result<Vec<String>, ExitFailure>
pub fn get_snippets_from_string( &self, markdown: String, lang: String, ignore: Vec<String>, ) -> Result<Vec<String>, ExitFailure>
Returns a vector of extracted code snippets.
§Arguments
markdown- The markdown stringlang- The language of the code snippets defined after three backticksignore- Ignore those code snippets that include this string
Sourcepub fn get_snippets_from_file(
&self,
file: String,
lang: String,
ignore: Vec<String>,
) -> Result<Vec<String>, ExitFailure>
pub fn get_snippets_from_file( &self, file: String, lang: String, ignore: Vec<String>, ) -> Result<Vec<String>, ExitFailure>
Returns a vector of extracted code snippets.
§Arguments
file- The markdown filenamelang- The language of the code snippets defined after three backticksignore- Ignore those code snippets that include this string
Sourcepub fn write_snippets(
&self,
snippets: Vec<String>,
folder: String,
prefix: String,
ext: String,
) -> Result<(), ExitFailure>
pub fn write_snippets( &self, snippets: Vec<String>, folder: String, prefix: String, ext: String, ) -> Result<(), ExitFailure>
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 Freeze for MD2Src
impl RefUnwindSafe for MD2Src
impl Send for MD2Src
impl Sync for MD2Src
impl Unpin for MD2Src
impl UnsafeUnpin for MD2Src
impl UnwindSafe for MD2Src
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