egui_commonmark_backend/
lib.rs

1//! Shared code for egui_commonmark and egui_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_ui, Alert, AlertBundle},
21    // Pretty much every single element in this module is used by the proc macros
22    elements::*,
23    misc::{prepare_show, CodeBlock, CommonMarkOptions, Image, Link},
24};
25
26// The only struct that is allowed to use directly. (If one does not need egui_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);