pub struct Pandoc { /* private fields */ }
Expand description

the argument builder

Implementations

Get a new Pandoc object This function returns a builder object to configure the Pandoc execution.

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.

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.

Set or overwrite the document-class.

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.

Set or overwrite the output format.

Set or overwrite the input format

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.

Set input for Pandoc.

The input is given with pandoc::InputKind and overrides any inputs already supplied.

Example
// 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));

Set or overwrite the output filename.

Set the file name of the bibliography database.

Set the filename of the citation style file.

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.

Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook output.

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.

Set a custom latex template.

Set the header level that causes a new slide to be generated.

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.

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.

The provided filter function must live at least as long as the Pandoc instance, which will typically be achieved by making it a function, or else a closure which does not attempt to hold references to anything which isn’t 'static.

Add a PandocOption.

Add a raw command-line argument. You should generally use one of the convenience functions instead.

generate a latex template from the given settings

Warning: this function can panic in a lot of places.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.