[−][src]Struct pandoc::Pandoc
the argument builder
Methods
impl Pandoc
[src]
impl Pandoc
pub fn new() -> Pandoc
[src]
pub fn new() -> Pandoc
Get a new Pandoc object This function returns a builder object to configure the Pandoc execution.
pub fn add_latex_path_hint<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
path: &T
) -> &'p mut Pandoc
[src]
pub fn add_latex_path_hint<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
path: &T
) -> &'p mut Pandoc
Add a path hint to search for the LaTeX executable.
The supplied path is searched first for the latex executable, then the environment variable
PATH
, then some hard-coded location hints.
pub fn add_pandoc_path_hint<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
path: &T
) -> &'p mut Pandoc
[src]
pub fn add_pandoc_path_hint<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
path: &T
) -> &'p mut Pandoc
Add a path hint to search for the Pandoc executable.
The supplied path is searched first for the Pandoc executable, then the environment variable PATH
, then
some hard-coded location hints.
pub fn set_doc_class<'p>(&'p mut self, class: DocumentClass) -> &'p mut Pandoc
[src]
pub fn set_doc_class<'p>(&'p mut self, class: DocumentClass) -> &'p mut Pandoc
Set or overwrite the document-class.
pub fn set_show_cmdline<'p>(&'p mut self, flag: bool) -> &'p mut Pandoc
[src]
pub fn set_show_cmdline<'p>(&'p mut self, flag: bool) -> &'p mut Pandoc
Set whether Pandoc should print the used command-line
If set to true, the command-line to execute pandoc (as a subprocess) will be displayed on stdout.
pub fn set_output_format<'p>(
&'p mut self,
format: OutputFormat,
extensions: Vec<MarkdownExtension>
) -> &'p mut Pandoc
[src]
pub fn set_output_format<'p>(
&'p mut self,
format: OutputFormat,
extensions: Vec<MarkdownExtension>
) -> &'p mut Pandoc
Set or overwrite the output format.
pub fn set_input_format<'p>(
&'p mut self,
format: InputFormat,
extensions: Vec<MarkdownExtension>
) -> &'p mut Pandoc
[src]
pub fn set_input_format<'p>(
&'p mut self,
format: InputFormat,
extensions: Vec<MarkdownExtension>
) -> &'p mut Pandoc
Set or overwrite the input format
pub fn add_input<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
[src]
pub fn add_input<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
Add additional input files
The order of adding the files is the order in which they are processed, hence the order is
important.
This function does not work, if input has been already set to standard input using
set_input
.
pub fn set_input(&mut self, input: InputKind) -> &mut Pandoc
[src]
pub fn set_input(&mut self, input: InputKind) -> &mut Pandoc
Set input for Pandoc.
The input is given with pandoc::InputKind
and overrides any inputs already
supplied.
Example
fn main() { // pass in a string using standard input: let markdown = "**very** _important".into(); let mut p = pandoc::new(); // assign to variable to increase life time p.set_input(pandoc::InputKind::Pipe(markdown)); }
pub fn set_output<'p>(&'p mut self, output: OutputKind) -> &'p mut Pandoc
[src]
pub fn set_output<'p>(&'p mut self, output: OutputKind) -> &'p mut Pandoc
Set or overwrite the output filename.
pub fn set_bibliography<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
[src]
pub fn set_bibliography<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
Set the file name of the bibliography database.
pub fn set_csl<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
[src]
pub fn set_csl<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
Set the filename of the citation style file.
pub fn set_toc<'p>(&'p mut self) -> &'p mut Pandoc
[src]
pub fn set_toc<'p>(&'p mut self) -> &'p mut Pandoc
Enable the generation of a table of contents
By default, documents are transformed as they are. If this option is set, a table of contents is added right in front of the actual document.
pub fn set_chapters<'p>(&'p mut self) -> &'p mut Pandoc
[src]
pub fn set_chapters<'p>(&'p mut self) -> &'p mut Pandoc
Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook output.
pub fn set_number_sections<'p>(&'p mut self) -> &'p mut Pandoc
[src]
pub fn set_number_sections<'p>(&'p mut self) -> &'p mut Pandoc
Set custom prefix for sections.
If this function is called, all sections will be numbered. Normally, sections in LaTeX, ConTeXt, HTML, or EPUB output are unnumbered.
pub fn set_latex_template<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
[src]
pub fn set_latex_template<'p, T: AsRef<Path> + ?Sized>(
&'p mut self,
filename: &T
) -> &'p mut Pandoc
Set a custom latex template.
pub fn set_slide_level<'p>(&'p mut self, level: u32) -> &'p mut Pandoc
[src]
pub fn set_slide_level<'p>(&'p mut self, level: u32) -> &'p mut Pandoc
Set the header level that causes a new slide to be generated.
pub fn set_variable<'p, T: AsRef<str> + ?Sized, U: AsRef<str> + ?Sized>(
&'p mut self,
key: &T,
value: &U
) -> &'p mut Pandoc
[src]
pub fn set_variable<'p, T: AsRef<str> + ?Sized, U: AsRef<str> + ?Sized>(
&'p mut self,
key: &T,
value: &U
) -> &'p mut Pandoc
Set a custom variable.
This method sets a custom Pandoc variable. It is adviced not to use this function, because there are convenience functions for most of the available variables.
pub fn add_filter<'p>(
&'p mut self,
filter: fn(_: String) -> String
) -> &'p mut Pandoc
[src]
pub fn add_filter<'p>(
&'p mut self,
filter: fn(_: String) -> String
) -> &'p mut Pandoc
Add a Pandoc filter.
Pandoc parses any of the supported input formats to an abstract syntax tree (AST). If a filter is specified, it will receive a JSON representation of this AST and can transform it to its liking and add/modify/remove elements. The output is then passed back to Pandoc.
pub fn add_option<'p>(&'p mut self, option: PandocOption) -> &'p mut Pandoc
[src]
pub fn add_option<'p>(&'p mut self, option: PandocOption) -> &'p mut Pandoc
Add a PandocOption.
pub fn add_options<'p>(&'p mut self, options: &[PandocOption]) -> &'p mut Pandoc
[src]
pub fn add_options<'p>(&'p mut self, options: &[PandocOption]) -> &'p mut Pandoc
pub fn generate_latex_template<T: AsRef<str> + ?Sized>(self, filename: &T)
[src]
pub fn generate_latex_template<T: AsRef<str> + ?Sized>(self, filename: &T)
generate a latex template from the given settings
Warning: this function can panic in a lot of places.
pub fn execute(self) -> Result<PandocOutput, PandocError>
[src]
pub fn execute(self) -> Result<PandocOutput, PandocError>
Execute the Pandoc configured command.
A successful Pandoc run can return either the path to a file written by
the operation, or the result of the operation from stdio
.
The PandocOutput
variant returned depends on the OutputKind
configured:
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more