Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

egui_commonmark

> 编程语言
Open source

Markdown viewer for egui

176 stars0 likes0 views
WebsiteGitHub

About

Markdown viewer for egui

A commonmark viewer for egui

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:

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

* A list
* [ ] Checkbox
";

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

Compile time evaluation of markdown

If you want to embed markdown directly into the binary then you can enable the macros feature. This will do the parsing of the markdown at compile time and output egui widgets.

Example

rust
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

rust
use egui_commonmark::{CommonMarkCache, commonmark_str};
let mut cache = CommonMarkCache::default();
commonmark_str!(ui, &mut cache, "content.md");

Features

  • macros: macros for compile time parsing of markdown
  • 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
  • embedded_image: Load base64 image data urls from within markdown files

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.

FAQ

URL is not displayed when hovering over a link

By default egui does not show urls when you hover hyperlinks. To enable it, you can do the following before calling any ui related functions:

rust
ui.style_mut().url_in_tooltip = true;

MSRV Policy

This crate uses the same MSRV as the latest released egui version.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustcommonmarkeguimarkdownrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言