egui_commonmark_macros

Crates.ioegui_commonmark_macros
lib.rsegui_commonmark_macros
version0.16.0
sourcesrc
created_at2024-05-11 09:06:29.233449
updated_at2024-05-12 09:27:36.53315
descriptionEmbed markdown directly into the binary as egui widgets
homepage
repositoryhttps://github.com/lampsitter/egui_commonmark
max_upload_size
id1236748
size49,588
(lampsitter)

documentation

https://docs.rs/egui_commonmark_macros

README

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.

Commit count: 290

cargo fmt