Skip to content

Commit

Permalink
preliminary markdown support
Browse files Browse the repository at this point in the history
  • Loading branch information
x86y committed Jul 22, 2024
1 parent 1ad5ba4 commit 968b560
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 20 deletions.
188 changes: 174 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ directories-next = "2.0"
cbqn = { version = "0.1.0", default-features=false, optional = true }
phf = "0.11.1"
unicode-segmentation = "1.10.1"
iced = { git = "https://github.com/iced-rs/iced", features = ["async-std", "debug", "lazy", "svg", "advanced"], rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
iced = { git = "https://github.com/iced-rs/iced", features = ["async-std", "debug", "lazy", "svg", "advanced", "markdown", "highlighter"], rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
iced_core = { git = "https://github.com/iced-rs/iced", rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
iced_runtime = { git = "https://github.com/iced-rs/iced", rev = "dcdf1307006883f50083c186ca7b8656bfa60873" }
# itertools = "0.11.0"
# tracing = "0.1.37"
# tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
ngnk = { version = "0.2.3", optional = true}


Expand Down
11 changes: 9 additions & 2 deletions src/views/toolbar.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use iced::{
widget::{button, container, text, tooltip},
widget::{button, container, markdown, text, tooltip},
Element,
};
use iced_core::{text::LineHeight, Font};
Expand Down Expand Up @@ -32,7 +32,14 @@ pub fn toolbar_view<'a>() -> Element<'a, Message> {
button(bqn386!(glyph))
.style(btnstyle)
.on_press(Message::ToolbarClick(glyph.to_string())),
glyph_to_documentation(*glyph),
markdown(
markdown::parse(
glyph_to_documentation(*glyph),
iced::theme::Palette::DRACULA,
),
markdown::Settings::default(),
(),
),
tooltip::Position::FollowCursor,
)
.style(toolbarstyle),
Expand Down

0 comments on commit 968b560

Please sign in to comment.