gorbie_commonmark_backend/lib.rs
1//! Shared code for gorbie_commonmark and gorbie_commonmark_macro. Breaking changes will happen and
2//! should ideally not be relied upon. Only items that can been seen in this documentation
3//! can be safely used directly.
4
5#[doc(hidden)]
6pub mod alerts;
7#[doc(hidden)]
8pub mod elements;
9#[doc(hidden)]
10pub mod misc;
11#[doc(hidden)]
12pub mod pulldown;
13
14#[cfg(feature = "embedded_image")]
15mod data_url_loader;
16
17// For ease of use in proc macros
18#[doc(hidden)]
19pub use {
20 alerts::{Alert, AlertBundle, alert_ui},
21 // Pretty much every single element in this module is used by the proc macros
22 elements::*,
23 misc::{CodeBlock, CommonMarkOptions, Image, Link, prepare_show},
24};
25
26// The only struct that is allowed to use directly. (If one does not need gorbie_commonmark)
27pub use misc::CommonMarkCache;
28
29/// Takes [`egui::Ui`], the math text to be rendered and whether it is inline
30pub type RenderMathFn = dyn Fn(&mut egui::Ui, &str, bool);
31/// Takes [`egui::Ui`] and the html text to be rendered/used
32pub type RenderHtmlFn = dyn Fn(&mut egui::Ui, &str);