Backend

Trait Backend 

Source
pub trait Backend: Send + Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn supported_formats(&self) -> &'static [OutputFormat];
    fn glue_extension_types(&self) -> &'static [&'static str];
    fn allow_auto_glue(&self) -> bool;
    fn register_filters(&self, glue: &mut Glue);
    fn compile(
        &self,
        glue_content: &str,
        quill: &Quill,
        opts: &RenderOptions,
    ) -> Result<RenderResult, RenderError>;
}
Expand description

Backend trait for rendering different output formats

Required Methods§

Source

fn id(&self) -> &'static str

Get the backend identifier (e.g., “typst”, “latex”)

Source

fn supported_formats(&self) -> &'static [OutputFormat]

Get supported output formats

Source

fn glue_extension_types(&self) -> &'static [&'static str]

Get the glue file extensions accepted by this backend (e.g., &[“.typ”, “.tex”]) Returns an empty array to disable custom glue files.

Source

fn allow_auto_glue(&self) -> bool

Whether this backend allows automatic JSON glue generation

Source

fn register_filters(&self, glue: &mut Glue)

Register backend-specific filters with the glue environment

Source

fn compile( &self, glue_content: &str, quill: &Quill, opts: &RenderOptions, ) -> Result<RenderResult, RenderError>

Compile the glue content into final artifacts

Implementors§