[][src]Crate katex

This crate offers Rust bindings to KaTeX. This allows you to render LaTeX equations to HTML.

Usage

Add this to your Cargo.toml:

[dependencies]
katex = "0.1"

Examples

let html = katex::render("E = mc^2").unwrap();

let opts = katex::Opts::builder().display_mode(true).build().unwrap();
let html_in_display_mode = katex::render_with_opts("E = mc^2", opts).unwrap();

Structs

Opts

Options to be passed to KaTeX.

OptsBuilder

Builder for Opts.

TrustCallBack

A callback function to determine whether to trust users' input. It accepts TrustContext and returns a bool. See OptsBuilder::trust_callback.

TrustContext

The input used by the TrustCallBack. See OptsBuilder::trust_callback.

Enums

Error

Error type for this crate.

OutputType

Output type from KaTeX.

Functions

render

Render LaTeX equation to HTML.

render_with_opts

Render LaTeX equation to HTML with additional options.

Type Definitions

Result

Alias to core::result::Result<T, katex::Error>