Skip to content

Commit 968b560

Browse files
committed
preliminary markdown support
1 parent 1ad5ba4 commit 968b560

File tree

3 files changed

+184
-20
lines changed

3 files changed

+184
-20
lines changed

Cargo.lock

+174-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ directories-next = "2.0"
1313
cbqn = { version = "0.1.0", default-features=false, optional = true }
1414
phf = "0.11.1"
1515
unicode-segmentation = "1.10.1"
16-
iced = { git = "https://github.com/iced-rs/iced", features = ["async-std", "debug", "lazy", "svg", "advanced"], rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
16+
iced = { git = "https://github.com/iced-rs/iced", features = ["async-std", "debug", "lazy", "svg", "advanced", "markdown", "highlighter"], rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
1717
iced_core = { git = "https://github.com/iced-rs/iced", rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
1818
iced_runtime = { git = "https://github.com/iced-rs/iced", rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
19-
# itertools = "0.11.0"
20-
# tracing = "0.1.37"
21-
# tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
2219
ngnk = { version = "0.2.3", optional = true}
2320

2421

src/views/toolbar.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use iced::{
2-
widget::{button, container, text, tooltip},
2+
widget::{button, container, markdown, text, tooltip},
33
Element,
44
};
55
use iced_core::{text::LineHeight, Font};
@@ -32,7 +32,14 @@ pub fn toolbar_view<'a>() -> Element<'a, Message> {
3232
button(bqn386!(glyph))
3333
.style(btnstyle)
3434
.on_press(Message::ToolbarClick(glyph.to_string())),
35-
glyph_to_documentation(*glyph),
35+
markdown(
36+
markdown::parse(
37+
glyph_to_documentation(*glyph),
38+
iced::theme::Palette::DRACULA,
39+
),
40+
markdown::Settings::default(),
41+
(),
42+
),
3643
tooltip::Position::FollowCursor,
3744
)
3845
.style(toolbarstyle),

0 commit comments

Comments
 (0)