From 45a02ece66a40cf57fc1e4cbe5ccf260cdd91e7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:01:36 +0000 Subject: [PATCH 1/2] chore(deps): bump the cargo-dependencies group across 1 directory with 3 updates Bumps the cargo-dependencies group with 3 updates in the / directory: [ansi-to-tui](https://github.com/uttarayan21/ansi-to-tui), [insta](https://github.com/mitsuhiko/insta) and [clap](https://github.com/clap-rs/clap). Updates `ansi-to-tui` from 6.0.0 to 7.0.0 - [Changelog](https://github.com/ratatui/ansi-to-tui/blob/master/CHANGELOG.md) - [Commits](https://github.com/uttarayan21/ansi-to-tui/commits/v7.0.0) Updates `insta` from 1.40.0 to 1.41.1 - [Release notes](https://github.com/mitsuhiko/insta/releases) - [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md) - [Commits](https://github.com/mitsuhiko/insta/compare/1.40.0...1.41.1) Updates `clap` from 4.5.20 to 4.5.21 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.20...clap_complete-v4.5.21) --- updated-dependencies: - dependency-name: ansi-to-tui dependency-type: direct:production update-type: version-update:semver-major dependency-group: cargo-dependencies - dependency-name: insta dependency-type: direct:production update-type: version-update:semver-minor dependency-group: cargo-dependencies - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: cargo-dependencies ... Signed-off-by: dependabot[bot] --- Cargo.lock | 54 ++++++++++++++++++++++++++++---------- markdown-reader/Cargo.toml | 2 +- tui-markdown/Cargo.toml | 4 +-- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d7be8b..3b4c7cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,12 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "ansi-to-tui" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c4af0bef1b514c9b6a32a773caf604c1390fa7913f4eaa23bfe76f251d6a42" +checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c" dependencies = [ "nom", - "ratatui", + "ratatui 0.29.0", "simdutf8", "smallvec", "thiserror", @@ -180,9 +180,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -496,7 +496,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" dependencies = [ - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -558,9 +558,9 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "insta" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" +checksum = "7e9ffc4d4892617c50a928c52b2961cb5174b6fc6ebf252b2fac9d21955c48b8" dependencies = [ "console", "lazy_static", @@ -662,7 +662,7 @@ dependencies = [ "color-eyre", "crossterm", "itertools", - "ratatui", + "ratatui 0.28.1", "time", "tracing", "tracing-error", @@ -946,7 +946,27 @@ dependencies = [ "strum_macros", "unicode-segmentation", "unicode-truncate", - "unicode-width", + "unicode-width 0.1.14", +] + +[[package]] +name = "ratatui" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" +dependencies = [ + "bitflags 2.6.0", + "cassowary", + "compact_str", + "indoc", + "instability", + "itertools", + "lru", + "paste", + "strum", + "unicode-segmentation", + "unicode-truncate", + "unicode-width 0.2.0", ] [[package]] @@ -1430,7 +1450,7 @@ dependencies = [ "itertools", "pretty_assertions", "pulldown-cmark", - "ratatui", + "ratatui 0.28.1", "rstest", "syntect", "tracing", @@ -1466,7 +1486,7 @@ checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" dependencies = [ "itertools", "unicode-segmentation", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -1475,6 +1495,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "utf8parse" version = "0.2.2" diff --git a/markdown-reader/Cargo.toml b/markdown-reader/Cargo.toml index 3227ff9..e24f2d2 100644 --- a/markdown-reader/Cargo.toml +++ b/markdown-reader/Cargo.toml @@ -13,7 +13,7 @@ repository.workspace = true authors.workspace = true [dependencies] -clap = { version = "4.5.19", features = ["derive"] } +clap = { version = "4.5.21", features = ["derive"] } color-eyre = "0.6.3" crossterm = "0.28.1" itertools = "0.13.0" diff --git a/tui-markdown/Cargo.toml b/tui-markdown/Cargo.toml index 957aa8e..db01d0a 100644 --- a/tui-markdown/Cargo.toml +++ b/tui-markdown/Cargo.toml @@ -25,7 +25,7 @@ cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] rustdoc-args = ["--cfg", "docsrs"] [dependencies] -ansi-to-tui = { version = "6.0.0", optional = true } +ansi-to-tui = { version = "7.0.0", optional = true } document-features = { version = "0.2.10", optional = true } itertools = "0.13.0" pretty_assertions = "1.4.1" @@ -37,5 +37,5 @@ tracing = "0.1.40" [dev-dependencies] indoc = "2.0.5" -insta = "1.40.0" +insta = "1.41.1" tracing-subscriber = "0.3.18" From 648459b08e2eb86498774a9653e1cd8e90b7795a Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 19 Nov 2024 19:43:20 -0800 Subject: [PATCH 2/2] bump ratatui to 0.29.0 --- .vscode/settings.json | 3 + Cargo.lock | 192 ++--- Cargo.toml | 2 +- ...i_markdown__tests__highlighted_code-2.snap | 373 +-------- ...__highlighted_code_with_indentation-2.snap | 747 ++---------------- 5 files changed, 184 insertions(+), 1133 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f5c4ed --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "rust-analyzer.cargo.features": "all" +} diff --git a/Cargo.lock b/Cargo.lock index 3b4c7cc..1bb3453 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "ansi-to-tui" @@ -45,7 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c" dependencies = [ "nom", - "ratatui 0.29.0", + "ratatui", "simdutf8", "smallvec", "thiserror", @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -68,36 +68,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "shlex", ] @@ -214,9 +214,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "color-eyre" @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "compact_str" @@ -311,6 +311,41 @@ dependencies = [ "winapi", ] +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "deranged" version = "0.3.11" @@ -375,9 +410,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -513,9 +548,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" dependencies = [ "allocator-api2", "equivalent", @@ -534,6 +569,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "indenter" version = "0.3.3" @@ -570,10 +611,14 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" +checksum = "b829f37dead9dc39df40c2d3376c179fdfd2ac771f53f55d3c30dc096a3c0c6e" dependencies = [ + "darling", + "indoc", + "pretty_assertions", + "proc-macro2", "quote", "syn", ] @@ -607,9 +652,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "linked-hash-map" @@ -662,7 +707,7 @@ dependencies = [ "color-eyre", "crossterm", "itertools", - "ratatui 0.28.1", + "ratatui", "time", "tracing", "tracing-error", @@ -828,9 +873,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -884,9 +929,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -928,27 +973,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "ratatui" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" -dependencies = [ - "bitflags 2.6.0", - "cassowary", - "compact_str", - "crossterm", - "instability", - "itertools", - "lru", - "paste", - "strum", - "strum_macros", - "unicode-segmentation", - "unicode-truncate", - "unicode-width 0.1.14", -] - [[package]] name = "ratatui" version = "0.29.0" @@ -958,6 +982,7 @@ dependencies = [ "bitflags 2.6.0", "cassowary", "compact_str", + "crossterm", "indoc", "instability", "itertools", @@ -980,13 +1005,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -1001,9 +1026,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1075,9 +1100,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -1088,9 +1113,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -1121,18 +1146,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -1141,9 +1166,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -1259,9 +1284,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -1292,18 +1317,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -1450,7 +1475,7 @@ dependencies = [ "itertools", "pretty_assertions", "pulldown-cmark", - "ratatui 0.28.1", + "ratatui", "rstest", "syntect", "tracing", @@ -1459,12 +1484,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-ident" @@ -1513,12 +1535,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "walkdir" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index 6c71f17..832899d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Joshka"] [workspace.dependencies] -ratatui = { version = "0.28.1", default-features = false } +ratatui = { version = "0.29.0", default-features = false } [patch.crates-io] # when developing ratatui, uncomment this line to use the local version diff --git a/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code-2.snap b/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code-2.snap index 7374069..575e080 100644 --- a/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code-2.snap +++ b/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code-2.snap @@ -1,352 +1,29 @@ --- source: tui-markdown/src/lib.rs expression: highlighted_code +snapshot_kind: text --- -Text { - lines: [ - Line { - spans: [ - Span { - content: "```rust", - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "fn", - style: Style { - fg: Some( - Rgb( - 180, - 142, - 173, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "main", - style: Style { - fg: Some( - Rgb( - 143, - 161, - 179, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "{", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "println!", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "\"", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "Hello, highlighted code!", - style: Style { - fg: Some( - Rgb( - 163, - 190, - 140, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "\"", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ";", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "}", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "```", - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, -} +Text::from_iter([ + Line::from("```rust"), + Line::from_iter([ + Span::from("fn").fg(Color::Rgb(180, 142, 173)), + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("main").fg(Color::Rgb(143, 161, 179)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("{").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from_iter([ + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("println!").fg(Color::Rgb(192, 197, 206)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from("\"").fg(Color::Rgb(192, 197, 206)), + Span::from("Hello, highlighted code!").fg(Color::Rgb(163, 190, 140)), + Span::from("\"").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + Span::from(";").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from(Span::from("}").fg(Color::Rgb(192, 197, 206))), + Line::from("```"), +]) diff --git a/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code_with_indentation-2.snap b/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code_with_indentation-2.snap index 06dc9e2..e4dec0e 100644 --- a/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code_with_indentation-2.snap +++ b/tui-markdown/src/snapshots/tui_markdown__tests__highlighted_code_with_indentation-2.snap @@ -1,700 +1,55 @@ --- source: tui-markdown/src/lib.rs expression: highlighted_code_indented +snapshot_kind: text --- -Text { - lines: [ - Line { - spans: [ - Span { - content: "```rust", - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "fn", - style: Style { - fg: Some( - Rgb( - 180, - 142, - 173, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "main", - style: Style { - fg: Some( - Rgb( - 143, - 161, - 179, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "{", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "//", - style: Style { - fg: Some( - Rgb( - 101, - 115, - 126, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: " This is a comment", - style: Style { - fg: Some( - Rgb( - 101, - 115, - 126, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "HelloWorldBuilder", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "::", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "new", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " .", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "with_text", - style: Style { - fg: Some( - Rgb( - 150, - 181, - 180, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "\"", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "Hello, highlighted code!", - style: Style { - fg: Some( - Rgb( - 163, - 190, - 140, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "\"", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " .", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "build", - style: Style { - fg: Some( - Rgb( - 150, - 181, - 180, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " .", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "show", - style: Style { - fg: Some( - Rgb( - 150, - 181, - 180, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: "(", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ")", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - Span { - content: ";", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: " ", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "}", - style: Style { - fg: Some( - Rgb( - 192, - 197, - 206, - ), - ), - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - Line { - spans: [ - Span { - content: "```", - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, - }, - ], - style: Style { - fg: None, - bg: None, - underline_color: None, - add_modifier: NONE, - sub_modifier: NONE, - }, - alignment: None, -} +Text::from_iter([ + Line::from("```rust"), + Line::from_iter([ + Span::from("fn").fg(Color::Rgb(180, 142, 173)), + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("main").fg(Color::Rgb(143, 161, 179)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("{").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from_iter([ + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("//").fg(Color::Rgb(101, 115, 126)), + Span::from(" This is a comment").fg(Color::Rgb(101, 115, 126)), + ]), + Line::from_iter([ + Span::from(" ").fg(Color::Rgb(192, 197, 206)), + Span::from("HelloWorldBuilder").fg(Color::Rgb(192, 197, 206)), + Span::from("::").fg(Color::Rgb(192, 197, 206)), + Span::from("new").fg(Color::Rgb(192, 197, 206)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from_iter([ + Span::from(" .").fg(Color::Rgb(192, 197, 206)), + Span::from("with_text").fg(Color::Rgb(150, 181, 180)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from("\"").fg(Color::Rgb(192, 197, 206)), + Span::from("Hello, highlighted code!").fg(Color::Rgb(163, 190, 140)), + Span::from("\"").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from_iter([ + Span::from(" .").fg(Color::Rgb(192, 197, 206)), + Span::from("build").fg(Color::Rgb(150, 181, 180)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from_iter([ + Span::from(" .").fg(Color::Rgb(192, 197, 206)), + Span::from("show").fg(Color::Rgb(150, 181, 180)), + Span::from("(").fg(Color::Rgb(192, 197, 206)), + Span::from(")").fg(Color::Rgb(192, 197, 206)), + Span::from(";").fg(Color::Rgb(192, 197, 206)), + ]), + Line::from(Span::from(" ").fg(Color::Rgb(192, 197, 206))), + Line::from(Span::from("}").fg(Color::Rgb(192, 197, 206))), + Line::from("```"), +])