diff --git a/Cargo.lock b/Cargo.lock index 3672546..3eea5fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1254,6 +1254,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1918,6 +1927,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "getopts" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +dependencies = [ + "unicode-width", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -2319,6 +2337,7 @@ source = "git+https://github.com/iced-rs/iced?rev=dcdf1307006883f50083c186ca7b86 dependencies = [ "iced_core", "iced_futures", + "iced_highlighter", "iced_renderer", "iced_widget", "iced_winit", @@ -2377,6 +2396,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "iced_highlighter" +version = "0.13.0-dev" +source = "git+https://github.com/iced-rs/iced?rev=dcdf1307006883f50083c186ca7b8656bfa60873#dcdf1307006883f50083c186ca7b8656bfa60873" +dependencies = [ + "iced_core", + "once_cell", + "syntect", +] + [[package]] name = "iced_renderer" version = "0.13.0-dev" @@ -2442,14 +2471,17 @@ name = "iced_widget" version = "0.13.0-dev" source = "git+https://github.com/iced-rs/iced?rev=dcdf1307006883f50083c186ca7b8656bfa60873#dcdf1307006883f50083c186ca7b8656bfa60873" dependencies = [ + "iced_highlighter", "iced_renderer", "iced_runtime", "num-traits", "once_cell", "ouroboros", + "pulldown-cmark 0.11.0", "rustc-hash 2.0.0", "thiserror", "unicode-segmentation", + "url", ] [[package]] @@ -3032,6 +3064,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.19" @@ -3350,6 +3388,28 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "onig" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +dependencies = [ + "bitflags 1.3.2", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "openssl" version = "0.10.66" @@ -3656,6 +3716,19 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "plist" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" +dependencies = [ + "base64 0.22.1", + "indexmap 2.2.6", + "quick-xml 0.32.0", + "serde", + "time 0.3.36", +] + [[package]] name = "png" version = "0.17.13" @@ -3700,6 +3773,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3830,6 +3909,34 @@ dependencies = [ "unicase", ] +[[package]] +name = "pulldown-cmark" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8746739f11d39ce5ad5c2520a9b75285310dbfe78c541ccf832d38615765aec0" +dependencies = [ + "bitflags 2.6.0", + "getopts", + "memchr", + "pulldown-cmark-escape", + "unicase", +] + +[[package]] +name = "pulldown-cmark-escape" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae" + +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + [[package]] name = "quick-xml" version = "0.34.0" @@ -4937,6 +5044,28 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "syntect" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" +dependencies = [ + "bincode", + "bitflags 1.3.2", + "flate2", + "fnv", + "once_cell", + "onig", + "plist", + "regex-syntax", + "serde", + "serde_derive", + "serde_json", + "thiserror", + "walkdir", + "yaml-rust", +] + [[package]] name = "sys-locale" version = "0.3.1" @@ -5060,11 +5189,32 @@ dependencies = [ "libc", "standback", "stdweb", - "time-macros", + "time-macros 0.1.1", "version_check", "winapi", ] +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros 0.2.18", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + [[package]] name = "time-macros" version = "0.1.1" @@ -5075,6 +5225,16 @@ dependencies = [ "time-macros-impl", ] +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "time-macros-impl" version = "0.1.2" @@ -5655,7 +5815,7 @@ checksum = "9bd0acb6d70885ea0c343749019ba74f015f64a9d30542e66db69b49b7e28186" dependencies = [ "anyhow", "id-arena", - "pulldown-cmark", + "pulldown-cmark 0.8.0", "unicode-normalization", "unicode-xid", ] @@ -6008,7 +6168,7 @@ dependencies = [ "byteorder", "cfg-if", "num_enum 0.5.11", - "time", + "time 0.2.27", "wai-bindgen-gen-core", "wai-bindgen-gen-rust", "wai-bindgen-gen-rust-wasm", @@ -6169,7 +6329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7b56f89937f1cf2ee1f1259cf2936a17a1f45d8f0aa1019fae6d470d304cfa6" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.34.0", "quote", ] @@ -6896,9 +7056,9 @@ checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] name = "zbus" -version = "4.3.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "851238c133804e0aa888edf4a0229481c753544ca12a60fd1c3230c8a500fe40" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" dependencies = [ "async-broadcast", "async-executor", @@ -6934,9 +7094,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.3.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5a3f12c20bd473be3194af6b49d50d7bb804ef3192dc70eddedb26b85d9da7" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -6984,9 +7144,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "4.1.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1724a2b330760dc7d2a8402d841119dc869ef120b139d29862d6980e9c75bfc9" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" dependencies = [ "endi", "enumflags2", @@ -6997,9 +7157,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.1.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55025a7a518ad14518fb243559c058a2e5b848b015e31f1d90414f36e3317859" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -7010,9 +7170,9 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc242db087efc22bd9ade7aa7809e4ba828132edc312871584a6b4391bdf8786" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 1c3af7e..01000e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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} diff --git a/src/views/toolbar.rs b/src/views/toolbar.rs index 2047fb1..7849feb 100644 --- a/src/views/toolbar.rs +++ b/src/views/toolbar.rs @@ -1,5 +1,5 @@ use iced::{ - widget::{button, container, text, tooltip}, + widget::{button, container, markdown, text, tooltip}, Element, }; use iced_core::{text::LineHeight, Font}; @@ -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),