From 554e4d7e5bb618ef72db8f424b7fcdfffcd0fa3c Mon Sep 17 00:00:00 2001 From: kitsunecafe <10284516+kitsunecafe@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:33:27 -0500 Subject: [PATCH] prepare for publish --- Cargo.lock | 57 +++++++++++++++++++++++++++++------------------------- Cargo.toml | 10 +++++++--- README.md | 2 ++ src/lib.rs | 16 +++++++++++++++ 4 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 README.md diff --git a/Cargo.lock b/Cargo.lock index bfb3bd2..38cd0b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "anyhow" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" + [[package]] name = "base64" version = "0.21.7" @@ -55,9 +61,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -101,9 +107,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -187,9 +193,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" @@ -247,7 +253,7 @@ dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] @@ -258,15 +264,9 @@ checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -276,7 +276,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "roxy_core" version = "0.1.0" -source = "git+https://fem.mint.lgbt/kitsunecafe/roxy-core.git#dc17ebdb5d18778ba3ea9acddfc9a52214f88ed8" +source = "git+https://fem.mint.lgbt/kitsunecafe/roxy-core.git#6b5b3520b0623af071ffd3053c60448c8a0b66d3" +dependencies = [ + "anyhow", + "thiserror", +] [[package]] name = "roxy_syntect" @@ -290,9 +294,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "safemem" @@ -342,9 +346,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -353,9 +357,9 @@ dependencies = [ [[package]] name = "syntect" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02b4b303bf8d08bfeb0445cba5068a3d306b6baece1d5582171a9bf49188f91" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bincode", "bitflags", @@ -364,8 +368,9 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax 0.7.5", + "regex-syntax", "serde", + "serde_derive", "serde_json", "thiserror", "walkdir", @@ -374,18 +379,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 92e3194..b778ce8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,12 +2,16 @@ name = "roxy_syntect" version = "0.1.0" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +authors = ["Rowan "] +repository = "https://fem.mint.lgbt/kitsunecafe/roxy-syntect" +license = "GPL-3.0-or-later" +readme = "README.md" +description = "Roxy plugin for providing syntax highlighting via Syntect" +homepage = "https://roxy-docs.netlify.app" [dependencies] once_cell = "1.19.0" regex = "1.10.3" -roxy_core = { git = "https://fem.mint.lgbt/kitsunecafe/roxy-core.git" } +roxy_core = "0.1.0" syntect = "5.1.0" diff --git a/README.md b/README.md new file mode 100644 index 0000000..e26e231 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# roxy-syntect + diff --git a/src/lib.rs b/src/lib.rs index 8d94682..7cc1be1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,3 +110,19 @@ impl<'a> Parse for SyntectParser<'a> { Ok(()) } } + +#[cfg(test)] +mod tests { + use roxy_core::roxy::Parse; + + use crate::SyntectParser; + + #[test] + fn invalid_syntax() { + let mut parser = SyntectParser::default(); + let data = b"```toml\n[roxy]\nslug_word_limit = 8\n[syntect]\ntheme = \"base16-ocean.dark\"\ntheme_dir = \"./themes\"```"; + let mut dst = Vec::new(); + parser.parse("test.html", data, &mut dst); + println!("{:?}", String::from_utf8(dst)); + } +}