Enum pandoc::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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.