#common-mark #egui

macro egui_commonmark_macros

Embed markdown directly into the binary as egui widgets

2 releases

0.16.0 May 12, 2024
0.16.0-alpha.1 May 11, 2024

#870 in GUI

Download history 145/week @ 2024-05-05 178/week @ 2024-05-12 18/week @ 2024-05-19

341 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.16"
# Specify what image formats you want to use
image = { version = "0.24", 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