Enum PandocOption

Source
#[non_exhaustive]
pub enum PandocOption {
Show 85 variants DataDir(PathBuf), Defaults(PathBuf), Strict, ParseRaw, Smart, OldDashes, BaseHeaderLevel(u32), ShiftHeadingLevelBy(i32), IndentedCodeClasses(String), Filter(PathBuf), LuaFilter(PathBuf), Normalize, PreserveTabs, TabStop(u32), TrackChanges(TrackChanges), ExtractMedia(PathBuf), Standalone, Template(PathBuf), Meta(String, Option<String>), Var(String, Option<String>), PrintDefaultTemplate(String), PrintDefaultDataFile(PathBuf), NoWrap, Columns(u32), TableOfContents, TableOfContentsDepth(u32), NoHighlight, HighlightStyle(String), IncludeInHeader(PathBuf), IncludeBeforeBody(PathBuf), IncludeAfterBody(PathBuf), SelfContained, Offline, Html5, HtmlQTags, Ascii, ReferenceLinks, AtxHeaders, TopLevelDivision(Tld), NumberSections, NumberOffset(Vec<u32>), NoTexLigatures, Listings, Incremental, SlideLevel(u32), SectionDivs, DefaultImageExtension(String), EmailObfuscation(EmailObfuscation), IdPrefix(String), TitlePrefix(String), Css(URL), ReferenceOdt(PathBuf), ReferenceDocx(PathBuf), ReferenceDoc(PathBuf), EpubStylesheet(PathBuf), EpubCoverImage(PathBuf), EpubMetadata(PathBuf), EpubEmbedFont(PathBuf), EpubChapterLevel(u32), PdfEngine(PathBuf), PdfEngineOpt(String), Citeproc, Bibliography(PathBuf), Csl(PathBuf), CitationAbbreviations(PathBuf), Natbib, Biblatex, LatexMathML(Option<URL>), AsciiMathML(Option<URL>), MathML(Option<URL>), MimeTex(Option<URL>), WebTex(Option<URL>), JsMath(Option<URL>), MathJax(Option<URL>), Katex(Option<URL>), KatexStylesheet(URL), GladTex, Trace, DumpArgs, IgnoreArgs, Verbose, ResourcePath(Vec<PathBuf>), RuntimeSystem(Vec<PandocRuntimeSystemOption>), Sandbox, EOL(String),
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

DataDir(PathBuf)

–data-dir=DIRECTORY

§

Defaults(PathBuf)

–defaults=FILE

§

Strict

–strict

§

ParseRaw

-R –parse-raw

§

Smart

-S –smart

§

OldDashes

–old-dashes

§

BaseHeaderLevel(u32)

👎Deprecated: replaced by ShiftHeadingLevelBy

–base-header-level=NUMBER

§

ShiftHeadingLevelBy(i32)

–shift-heading-level-by=NUMBER,

§

IndentedCodeClasses(String)

–indented-code-classes=STRING

§

Filter(PathBuf)

-F PROGRAM –filter=PROGRAM

§

LuaFilter(PathBuf)

-L SCRIPT –lua-filter=SCRIPT

§

Normalize

–normalize

§

PreserveTabs

-p –preserve-tabs

§

TabStop(u32)

–tab-stop=NUMBER

§

TrackChanges(TrackChanges)

–track-changes=accept|reject|all

§

ExtractMedia(PathBuf)

–extract-media=PATH

§

Standalone

-s –standalone

§

Template(PathBuf)

–template=FILENAME

§

Meta(String, Option<String>)

-M KEY[:VALUE] –metadata=KEY[:VALUE]

§

Var(String, Option<String>)

-V KEY[:VALUE] –variable=KEY[:VALUE]

§

PrintDefaultTemplate(String)

-D FORMAT –print-default-template=FORMAT

§

PrintDefaultDataFile(PathBuf)

–print-default-data-file=FILE

§

NoWrap

–no-wrap

§

Columns(u32)

–columns=NUMBER

§

TableOfContents

–toc, –table-of-contents

§

TableOfContentsDepth(u32)

–toc-depth=NUMBER

§

NoHighlight

–no-highlight

§

HighlightStyle(String)

–highlight-style=STYLE

§

IncludeInHeader(PathBuf)

-H FILENAME –include-in-header=FILENAME

§

IncludeBeforeBody(PathBuf)

-B FILENAME –include-before-body=FILENAME

§

IncludeAfterBody(PathBuf)

-A FILENAME –include-after-body=FILENAME

§

SelfContained

–self-contained

§

Offline

–offline

§

Html5

-5 –html5

§

HtmlQTags

–html-q-tags

§

Ascii

–ascii

–reference-links

§

AtxHeaders

–atx-headers

§

TopLevelDivision(Tld)

–top-level-division=

§

NumberSections

-N –number-sections

§

NumberOffset(Vec<u32>)

–number-offset=NUMBERS

§

NoTexLigatures

–no-tex-ligatures

§

Listings

–listings

§

Incremental

-i –incremental

§

SlideLevel(u32)

–slide-level=NUMBER

§

SectionDivs

–section-divs

§

DefaultImageExtension(String)

–default-image-extension=extension

§

EmailObfuscation(EmailObfuscation)

–email-obfuscation=none|javascript|references

§

IdPrefix(String)

–id-prefix=STRING

§

TitlePrefix(String)

-T STRING –title-prefix=STRING

§

Css(URL)

-c URL –css=URL

§

ReferenceOdt(PathBuf)

–reference-odt=FILENAME

§

ReferenceDocx(PathBuf)

👎Deprecated: replaced by ReferenceDoc

–reference-docx=FILENAME

§

ReferenceDoc(PathBuf)

–reference-doc=FILENAME

§

EpubStylesheet(PathBuf)

–epub-stylesheet=FILENAME

§

EpubCoverImage(PathBuf)

–epub-cover-image=FILENAME

§

EpubMetadata(PathBuf)

–epub-metadata=FILENAME

§

EpubEmbedFont(PathBuf)

–epub-embed-font=FILE

§

EpubChapterLevel(u32)

–epub-chapter-level=NUMBER

§

PdfEngine(PathBuf)

–pdf-engine=PROGRAM

§

PdfEngineOpt(String)

–pdf-engine-opt=STRING

§

Citeproc

–citeproc

§

Bibliography(PathBuf)

–bibliography=FILE

§

Csl(PathBuf)

–csl=FILE

§

CitationAbbreviations(PathBuf)

–citation-abbreviations=FILE

§

Natbib

–natbib

§

Biblatex

–biblatex

§

LatexMathML(Option<URL>)

-mURL –latexmathml[=URL], –asciimathml[=URL]

§

AsciiMathML(Option<URL>)

–asciimathml[=URL]

§

MathML(Option<URL>)

–mathml[=URL]

§

MimeTex(Option<URL>)

–mimetex[=URL]

§

WebTex(Option<URL>)

–webtex[=URL]

§

JsMath(Option<URL>)

–jsmath[=URL]

§

MathJax(Option<URL>)

–mathjax[=URL]

§

Katex(Option<URL>)

–katex[=URL]

§

KatexStylesheet(URL)

–katex-stylesheet=URL

§

GladTex

-gladtex

§

Trace

–trace

§

DumpArgs

–dump-args

§

IgnoreArgs

–ignore-args

§

Verbose

–verbose

§

ResourcePath(Vec<PathBuf>)

–resource-path=PATH

§

RuntimeSystem(Vec<PandocRuntimeSystemOption>)

+RTS OPTIONS -RTS

In Pandoc’s “A note on security” section of the manual (link), there is a recommendation to set a heap size limit to prevent pathological corner cases.

The full list of “RTS” options can be found in the Haskell “Runtime control” section of the manual (link). The Runtime System options are way more extensive than the -M option, and cover a lot of use-cases that aren’t needed while using pandoc in a production setting.

§Example Usage
let mut pandoc = pandoc::new();
pandoc.add_option(pandoc::PandocOption::RuntimeSystem(vec![
  // Limit the heap size to 512 MB while processing an arbitrary input file.
  pandoc::PandocRuntimeSystemOption::MaximumHeapMemory("512M".to_string()),
]));
§

Sandbox

–sandbox

This option is strongly recommended for any use-case involving untrusted user input. Note that it does require a pandoc binary compiled with the embed_data_files option, in order to process some formats such as docx without external file access.

§

EOL(String)

Manually specify line endings: crlf (Windows), lf (macOS/Linux/UNIX), or native (line endings appropriate to the OS on which pandoc is being run). The default is native.

Trait Implementations§

Source§

impl Clone for PandocOption

Source§

fn clone(&self) -> PandocOption

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PandocOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PandocOption

Source§

fn eq(&self, other: &PandocOption) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PandocOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.