#common-mark #egui #markdown #embed #macro #viewer #ui

macro egui_commonmark_macros

Embed markdown directly into the binary as egui widgets

3 unstable releases

new 0.17.0 Jul 3, 2024
0.16.0 May 12, 2024
0.16.0-alpha.1 May 11, 2024

#875 in GUI

Download history 274/week @ 2024-05-06 51/week @ 2024-05-13 18/week @ 2024-05-20 101/week @ 2024-05-27 145/week @ 2024-06-03 85/week @ 2024-06-10 59/week @ 2024-06-17 95/week @ 2024-06-24

388 downloads per month
Used in egui_commonmark

MIT/Apache

76KB
1.5K SLoC

A commonmark viewer for egui

Crate Documentation

showcase

This crate is egui_commonmark's compile time variant. It is recommended to use this crate through egui_commonmark by enabling the macros feature.

Usage

In Cargo.toml:

egui_commonmark = "0.17"
# Specify what image formats you want to use
image = { version = "0.25", default-features = false, features = ["png"] }

Example

use egui_commonmark::{CommonMarkCache, commonmark};
let mut cache = CommonMarkCache::default();
let _response = commonmark!("example", ui, &mut cache, "# ATX Heading Level 1");

Alternatively you can embed a file

Example

use egui_commonmark::{CommonMarkCache, commonmark_str};
let mut cache = CommonMarkCache::default();
commonmark_str!("example_file", ui, &mut cache, "content.md");

License

Licensed under either of

at your option.

Dependencies

~7–14MB
~156K SLoC