Skip to main content

Crate dioxus_typst

Crate dioxus_typst 

Source
Expand description

A Dioxus component for rendering Typst documents as HTML.

This crate provides a Typst component that compiles Typst markup to HTML at runtime, allowing you to embed rich typeset content in Dioxus applications.

§Example

use dioxus::prelude::*;
use dioxus_typst::Typst;

#[component]
fn App() -> Element {
    let content = r#"
= Hello, Typst!

Some *formatted* text with math: $E = m c^2$
"#;

    rsx! {
        Typst { source: content.to_string() }
    }
}

Re-exports§

pub use Typst_completions::Component::Typst;

Structs§

CompileOptions
Options for configuring Typst compilation.
DocumentMetadata
Metadata extracted from a Typst document.
TypstProps
Properties for the Typst component.

Enums§

CompileError
Errors that can occur during Typst compilation.

Functions§

Typst
A Dioxus component that renders Typst markup as HTML.
extract_metadata
Compiles Typst source and extracts document metadata.