Skip to main content

affine_preview/
lib.rs

1#[cfg(feature = "mermaid")]
2mod mermaid;
3#[cfg(feature = "typst")]
4mod typst;
5
6#[cfg(feature = "mermaid")]
7pub use mermaid::{MermaidRenderOptions, render_mermaid_svg};
8#[cfg(feature = "typst")]
9pub use typst::{TypstRenderOptions, render_typst_svg};
10
11#[derive(Debug, thiserror::Error)]
12pub enum PreviewError {
13  #[error("{0}")]
14  Mermaid(String),
15  #[error("{0}")]
16  Typst(String),
17  #[error("failed to prepare preview cache: {0}")]
18  Cache(#[from] std::io::Error),
19}
20
21pub type Result<T> = std::result::Result<T, PreviewError>;