Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.57 KB

README.md

File metadata and controls

53 lines (35 loc) · 1.57 KB

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 add the following:

egui_commonmark = "0.8"

# If you don't need image loading you can ignore the dependencies below.

# Specify the the ways you want to load images, check egui_extras features
# for more info. Or use the feature "all-loaders" if you don't care.
egui_extras = { version = "<to-be-released>", features = ["image", "files"] }

# Opt into the image formats you want to load
image = { version = "0.24", 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

  • syntax_highlighting: Syntax highlighting inside code blocks with syntect

License

Licensed under either of

at your option.