egui_commonmark_macros

Crates.ioegui_commonmark_macros
lib.rsegui_commonmark_macros
version0.17.0
sourcesrc
created_at2024-05-11 09:06:29.233449
updated_at2024-07-03 14:19:19.860822
descriptionEmbed markdown directly into the binary as egui widgets
homepage
repositoryhttps://github.com/lampsitter/egui_commonmark
max_upload_size
id1236748
size49,735
(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.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.

Commit count: 297

cargo fmt