Skip to main content

egui_commonmark_backend_extended/
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 html_table;
11#[doc(hidden)]
12pub mod misc;
13#[doc(hidden)]
14pub mod pulldown;
15pub mod typography;
16
17#[cfg(feature = "embedded_image")]
18mod data_url_loader;
19
20// For ease of use in proc macros
21#[doc(hidden)]
22pub use {
23    alerts::{Alert, AlertBundle, alert_ui},
24    // Pretty much every single element in this module is used by the proc macros
25    elements::*,
26    misc::{CodeBlock, CommonMarkOptions, Image, Link, prepare_show},
27    typography::{Measurement, TypographyConfig},
28};
29
30// The only struct that is allowed to use directly. (If one does not need egui_commonmark)
31pub use misc::CommonMarkCache;
32
33/// Takes [`egui::Ui`], the math text to be rendered and whether it is inline
34pub type RenderMathFn = dyn Fn(&mut egui::Ui, &str, bool);
35/// Takes [`egui::Ui`] and the html text to be rendered/used
36pub type RenderHtmlFn = dyn Fn(&mut egui::Ui, &str);