25 releases (14 breaking)

0.15.0 Apr 2, 2024
0.14.0 Mar 26, 2024
0.13.0 Feb 20, 2024
0.10.2 Dec 13, 2023
0.1.3 Mar 24, 2022

#56 in GUI

Download history 1022/week @ 2024-01-03 818/week @ 2024-01-10 1440/week @ 2024-01-17 996/week @ 2024-01-24 1371/week @ 2024-01-31 1447/week @ 2024-02-07 1166/week @ 2024-02-14 1443/week @ 2024-02-21 1614/week @ 2024-02-28 1024/week @ 2024-03-06 1867/week @ 2024-03-13 1907/week @ 2024-03-20 1630/week @ 2024-03-27 2110/week @ 2024-04-03 3900/week @ 2024-04-10 2740/week @ 2024-04-17

10,587 downloads per month
Used in 18 crates (4 directly)

MIT/Apache

80KB
2K SLoC

A commonmark viewer for egui

Crate Documentation

showcase

While this crate's main focus is commonmark, it also supports a subset of Github's markdown syntax: tables, strikethrough, tasklists and footnotes.

Usage

In Cargo.toml:

egui_commonmark = "0.15"
# Specify what image formats you want to use
image = { version = "0.24", default-features = false, features = ["png"] }
use egui_commonmark::*;
let markdown =
r"# Hello world

* A list
* [ ] Checkbox
";

let mut cache = CommonMarkCache::default();
CommonMarkViewer::new("viewer").show(ui, &mut cache, markdown);

Features

  • better_syntax_highlighting: Syntax highlighting inside code blocks with syntect
  • svg: Support for viewing svg images
  • fetch: Images with urls will be downloaded and displayed

Examples

For an easy intro check out the hello_world example. To see all the different features egui_commonmark has to offer check out the book example.

License

Licensed under either of

at your option.

Dependencies

~5–21MB
~232K SLoC