diff --git a/devblog/devblog/client/Cargo.lock b/devblog/devblog/client/Cargo.lock index c6d538f..124335e 100644 --- a/devblog/devblog/client/Cargo.lock +++ b/devblog/devblog/client/Cargo.lock @@ -127,17 +127,13 @@ name = "client" version = "0.1.0" dependencies = [ "chrono", - "cookie", "gloo 0.11.0", "gloo-net 0.5.0", - "reqwasm", "serde", - "serde-wasm-bindgen 0.6.3", "serde_json", "stylist", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-cookies", "web-sys", "yew 0.21.0", "yew-router", @@ -155,16 +151,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "cookie" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" -dependencies = [ - "time", - "version_check", -] - [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -206,15 +192,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "either" version = "1.9.0" @@ -541,26 +518,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "gloo-net" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2899cb1a13be9020b010967adc6b2a8a343b6f1428b90238c9d53ca24decc6db" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils 0.1.7", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "gloo-net" version = "0.3.1" @@ -981,12 +938,6 @@ 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.17" @@ -1070,12 +1021,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "prettyplease" version = "0.2.16" @@ -1155,15 +1100,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "reqwasm" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b89870d729c501fa7a68c43bf4d938bbb3a8c156d333d90faa0e8b3e3212fb" -dependencies = [ - "gloo-net 0.1.0", -] - [[package]] name = "route-recognizer" version = "0.3.1" @@ -1363,37 +1299,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "time" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[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.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tokio" version = "1.35.1" @@ -1469,12 +1374,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "urlencoding" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb" - [[package]] name = "urlencoding" version = "2.1.3" @@ -1500,8 +1399,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", - "serde", - "serde_json", "wasm-bindgen-macro", ] @@ -1561,19 +1458,6 @@ version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" -[[package]] -name = "wasm-cookies" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "792b7c4fd62cde421f0e757620053efa7b0c23441c05c6ec02baf96cd74973be" -dependencies = [ - "chrono", - "js-sys", - "urlencoding 1.3.3", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "web-sys" version = "0.3.67" @@ -1763,7 +1647,7 @@ dependencies = [ "serde", "serde_urlencoded", "tracing", - "urlencoding 2.1.3", + "urlencoding", "wasm-bindgen", "web-sys", "yew 0.21.0", diff --git a/devblog/devblog/client/Cargo.toml b/devblog/devblog/client/Cargo.toml index dfce2bd..beb0117 100644 --- a/devblog/devblog/client/Cargo.toml +++ b/devblog/devblog/client/Cargo.toml @@ -7,17 +7,13 @@ edition = "2021" [dependencies] chrono = { version = "0.4.33", features = ["serde"] } -cookie = "0.18.0" gloo = "0.11.0" gloo-net = "0.5.0" -reqwasm = "0.5.0" serde = "1.0.196" -serde-wasm-bindgen = "0.6.3" serde_json = "1.0.113" stylist = { version = "0.13.0", features = ["yew", "parser"] } wasm-bindgen = "0.2.90" wasm-bindgen-futures = "0.4.40" -wasm-cookies = "0.2.1" web-sys = { version = "0.3.67", features = ["HtmlInputElement"] } yew = { version = "0.21.0", features = ["csr"] } yew-router = "0.18.0" diff --git a/devblog/devblog/client/src/components/markdown.rs b/devblog/devblog/client/src/components/markdown.rs new file mode 100644 index 0000000..cb8cc22 --- /dev/null +++ b/devblog/devblog/client/src/components/markdown.rs @@ -0,0 +1,30 @@ +use yew::{function_component, html, Html, Properties}; + +#[derive(Properties, PartialEq, Clone)] +pub struct Props { + pub content: String, +} + +#[function_component(Markdown)] +pub fn markdown(props: &Props) -> Html { + let html = props.content.lines().map(|line| match line { + l if l.starts_with("# ") => html! {
{line.replace("```", "")}
{line}
}, + }); + + html! { +{"Preview:"}
- // {parser} -
+