Skip to main content

ConvertOptions

Struct ConvertOptions 

Source
pub struct ConvertOptions<'a> {
Show 22 fields pub title: Option<&'a str>, pub default_title: Option<&'a str>, pub lang: &'a str, pub theme: Theme, pub allow_unsafe: bool, pub hardbreaks: bool, pub highlight: bool, pub highlight_languages: HighlightLanguages<'a>, pub math: Option<MathMode>, pub mermaid: Option<MermaidMode>, pub cjk_fonts: bool, pub minify: bool, pub embed_images: bool, pub base_path: Option<&'a Path>, pub css: Option<&'a str>, pub extra_css: Option<&'a str>, pub highlight_js: Option<&'a str>, pub highlight_css: Option<&'a str>, pub mathjax_js: Option<&'a str>, pub katex_js: Option<&'a str>, pub katex_css: Option<&'a str>, pub mermaid_js: Option<&'a str>,
}
Expand description

Options for convert.

Fields§

§title: Option<&'a str>

The title of the HTML file. When it is None, the title is looked up in the front matter and then in the first level-1 heading.

§default_title: Option<&'a str>

The title to use when no title can be found in the Markdown file.

§lang: &'a str

The lang attribute of the <html> element. An empty string omits the attribute.

§theme: Theme

The color theme.

§allow_unsafe: bool

Allow raw HTML and dangerous URLs.

§hardbreaks: bool

Treat a single line break as a <br>.

§highlight: bool

Embed highlight.js when the Markdown file has code blocks with a supported language.

§highlight_languages: HighlightLanguages<'a>

Which code block languages make highlight.js be embedded.

§math: Option<MathMode>

How the math is rendered. None leaves the math alone.

§mermaid: Option<MermaidMode>

How the Mermaid diagrams are rendered. None leaves a ```mermaid block as a code block.

§cjk_fonts: bool

Embed the CJK fonts.

§minify: bool

Minify the output HTML.

§embed_images: bool

Embed local images as data URLs.

§base_path: Option<&'a Path>

The directory that relative paths in the Markdown file are resolved against.

§css: Option<&'a str>

A stylesheet which replaces the built-in one.

§extra_css: Option<&'a str>

A stylesheet which is appended after all the other stylesheets.

§highlight_js: Option<&'a str>

A script which replaces the built-in highlight.js.

§highlight_css: Option<&'a str>

A stylesheet which replaces the built-in highlight.js theme.

§mathjax_js: Option<&'a str>

A script which replaces the built-in MathJax.

§katex_js: Option<&'a str>

A script which replaces the built-in KaTeX.

§katex_css: Option<&'a str>

A stylesheet which replaces the built-in KaTeX one.

§mermaid_js: Option<&'a str>

A script which replaces the built-in Mermaid.

Trait Implementations§

Source§

impl<'a> Clone for ConvertOptions<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ConvertOptions<'a>

Source§

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

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

impl Default for ConvertOptions<'_>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Freeze for ConvertOptions<'a>

§

impl<'a> RefUnwindSafe for ConvertOptions<'a>

§

impl<'a> Send for ConvertOptions<'a>

§

impl<'a> Sync for ConvertOptions<'a>

§

impl<'a> Unpin for ConvertOptions<'a>

§

impl<'a> UnsafeUnpin for ConvertOptions<'a>

§

impl<'a> UnwindSafe for ConvertOptions<'a>

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.