Crates.io | egui_commonmark_macros |
lib.rs | egui_commonmark_macros |
version | 0.18.0 |
source | src |
created_at | 2024-05-11 09:06:29.233449 |
updated_at | 2024-09-26 16:31:11.040075 |
description | Embed markdown directly into the binary as egui widgets |
homepage | |
repository | https://github.com/lampsitter/egui_commonmark |
max_upload_size | |
id | 1236748 |
size | 54,888 |
This crate is egui_commonmark
's compile time variant. It is recommended to use
this crate through egui_commonmark
by enabling the macros
feature.
In Cargo.toml:
egui_commonmark = "0.18"
# Specify what image formats you want to use
image = { version = "0.25", default-features = false, features = ["png"] }
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
use egui_commonmark::{CommonMarkCache, commonmark_str};
let mut cache = CommonMarkCache::default();
commonmark_str!(ui, &mut cache, "content.md");
Licensed under either of
at your option.