egui_commonmark_macros

Crates.ioegui_commonmark_macros
lib.rsegui_commonmark_macros
version0.18.0
sourcesrc
created_at2024-05-11 09:06:29.233449
updated_at2024-09-26 16:31:11.040075
descriptionEmbed markdown directly into the binary as egui widgets
homepage
repositoryhttps://github.com/lampsitter/egui_commonmark
max_upload_size
id1236748
size54,888
(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.18"
# 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.

Commit count: 316

cargo fmt