#common-mark #egui

macro egui_commonmark_macros

Embed markdown directly into the binary as egui widgets

5 releases (3 breaking)

new 0.19.0 Dec 17, 2024
0.18.0 Sep 26, 2024
0.17.0 Jul 3, 2024
0.16.0 May 12, 2024
0.16.0-alpha.1 May 11, 2024

#969 in GUI

Download history 90/week @ 2024-08-26 38/week @ 2024-09-02 56/week @ 2024-09-09 145/week @ 2024-09-16 209/week @ 2024-09-23 175/week @ 2024-09-30 166/week @ 2024-10-07 113/week @ 2024-10-14 56/week @ 2024-10-21 70/week @ 2024-10-28 77/week @ 2024-11-04 39/week @ 2024-11-11 111/week @ 2024-11-18 27/week @ 2024-11-25 137/week @ 2024-12-02 114/week @ 2024-12-09

392 downloads per month
Used in 2 crates (via egui_commonmark)

MIT/Apache

86KB
2K 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.19"
# 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!(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!(ui, &mut cache, "content.md");

License

Licensed under either of

at your option.

Dependencies

~7–12MB
~153K SLoC