diff --git a/Cargo.lock b/Cargo.lock index 9d8cd76..f26fbb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,27 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + [[package]] name = "axum" version = "0.8.3" @@ -86,18 +107,59 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + [[package]] name = "bytes" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +[[package]] +name = "cc" +version = "1.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +dependencies = [ + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "fnv" version = "1.0.7" @@ -152,6 +214,12 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + [[package]] name = "http" version = "1.3.1" @@ -233,12 +301,56 @@ dependencies = [ "tower-service", ] +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "itoa" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "libc" version = "0.2.171" @@ -293,6 +405,15 @@ dependencies = [ name = "mtgott" version = "0.1.0" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "object" version = "0.36.7" @@ -404,6 +525,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -416,6 +546,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "smallvec" version = "1.15.0" @@ -475,6 +611,47 @@ dependencies = [ "syn", ] +[[package]] +name = "toml" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900f6c86a685850b1bc9f6223b20125115ee3f31e01207d81655bbcc0aea9231" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10558ed0bd2a1562e630926a2d1f0b98c827da99fabd3fe20920a59642504485" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28391a4201ba7eb1984cfeb6862c0b3ea2cfe23332298967c749dddc0d6cd976" + [[package]] name = "tower" version = "0.5.2" @@ -535,6 +712,123 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -608,11 +902,22 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" +dependencies = [ + "memchr", +] + [[package]] name = "yyyi_ru" version = "0.1.0" dependencies = [ "axum", + "chrono", "mtgott", "tokio", + "toml", ] diff --git a/Cargo.toml b/Cargo.toml index 0b98f0e..a8224d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,5 @@ edition = "2024" axum = "0.8.3" tokio = { version = "1.44.1", features = ["rt-multi-thread"] } mtgott = { path = "./mtgott" } +toml="0.8.21" +chrono = "0.4.40" diff --git a/assets/HypertextPages/aboutme/en-US.html b/assets/HypertextPages/aboutme/en-US.html deleted file mode 100644 index 2e85ef3..0000000 --- a/assets/HypertextPages/aboutme/en-US.html +++ /dev/null @@ -1,3 +0,0 @@ -I am Andreev Gregory ({{age}} y.o.), -living in Moscow, learning programming, big fond of making patches to dwm, sometimes write some unhinged ravings. -Most interesting stuff about me gets published here. \ No newline at end of file diff --git a/assets/HypertextPages/aboutme/ru-RU.html b/assets/HypertextPages/aboutme/ru-RU.html deleted file mode 100644 index 1ab37a3..0000000 --- a/assets/HypertextPages/aboutme/ru-RU.html +++ /dev/null @@ -1,3 +0,0 @@ -Я Андреев Григорий ({{age}}), -живу в Москве, учусь прогать, люблю курить dwm и иногда пишу разного рода дичь. -Самым интересным в своей жизни делюсь вот здесь. \ No newline at end of file diff --git a/assets/HypertextPages/blog.html b/assets/HypertextPages/base.mtgott.html similarity index 66% rename from assets/HypertextPages/blog.html rename to assets/HypertextPages/base.mtgott.html index 8d3a2ce..94699da 100644 --- a/assets/HypertextPages/blog.html +++ b/assets/HypertextPages/base.mtgott.html @@ -1,12 +1,14 @@ +{@ main lang title body @} - + - Блог Гриши + {{title}} - + {#body#} - \ No newline at end of file + +{@} \ No newline at end of file diff --git a/assets/HypertextPages/blog.mtgott.html b/assets/HypertextPages/blog.mtgott.html new file mode 100644 index 0000000..99af163 --- /dev/null +++ b/assets/HypertextPages/blog.mtgott.html @@ -0,0 +1,6 @@ +{@ body $ @} +{%let pres = missing-text[$lang].blog %} +BLOG BODY +{%} +{@} +{$ main = d: base.main d.lang missing-text[d.lang].blog.title (this.body d) $} \ No newline at end of file diff --git a/assets/HypertextPages/index.html b/assets/HypertextPages/index.html deleted file mode 100644 index 00f3e6d..0000000 --- a/assets/HypertextPages/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - {{pres.index.title}} - - -
-
-

{{pres.index.about_me_header}}

-

{% if aboutme_template is string %} STRING {{lang_macro::incl('aboutme/')}} {% else %} NOT STRING{%endif%}

-
-
- - \ No newline at end of file diff --git a/assets/HypertextPages/index.mtgott.html b/assets/HypertextPages/index.mtgott.html new file mode 100644 index 0000000..5f78c95 --- /dev/null +++ b/assets/HypertextPages/index.mtgott.html @@ -0,0 +1,11 @@ +{@ body $ @} +{%let pres = missing-text[$lang].index %} +
+
+

{{ pres.about-me-header }}

+

{#pres.aboutme $#}

+
+
+{%} +{@} +{$ main = d: base.main d.lang missing-text[d.lang].index.title (this.body d) $} \ No newline at end of file diff --git a/assets/HypertextPages/missing-text/en-US.mtgott.html b/assets/HypertextPages/missing-text/en-US.mtgott.html new file mode 100644 index 0000000..98c26f1 --- /dev/null +++ b/assets/HypertextPages/missing-text/en-US.mtgott.html @@ -0,0 +1,12 @@ +{$ index $} + {@ title @} Gregory title page {@} + {@ about-me-header @} About me {@} + {@ aboutme $ @} + I am Andreev Gregory ({{$age}} y.o.), + living in Moscow, learning programming, big fond of making patches to dwm, sometimes write some unhinged ravings. + Most interesting stuff about me gets published here. + {@} +{$} +{$ blog $} + {@ title @} Gregory blog {@} +{$} \ No newline at end of file diff --git a/assets/HypertextPages/missing-text/ru-RU.mtgott.html b/assets/HypertextPages/missing-text/ru-RU.mtgott.html new file mode 100644 index 0000000..92dd501 --- /dev/null +++ b/assets/HypertextPages/missing-text/ru-RU.mtgott.html @@ -0,0 +1,12 @@ +{$index$} + {@ title @} Гришина заглавная страничка {@} + {@ about-me-header @} Обо мне {@} + {@ aboutme $ @} + Я Андреев Григорий ({{$age}} {%let d = o/o $age 10%}{%if == d 1%}год{%else if && (<= 2 d) (<= d 4) %}года{%else%}лет{%}{%}), + живу в Москве, учусь прогать, люблю курить dwm и иногда пишу разного рода дичь. + Самым интересным в своей жизни делюсь вот здесь. + {@} +{$} +{$blog$} + {@ title @} Гришин блог {@} +{$} \ No newline at end of file diff --git a/mtgott/src/bin/mtgott_cli.rs b/mtgott/src/bin/mtgott_cli.rs index 9ee2b97..f155640 100644 --- a/mtgott/src/bin/mtgott_cli.rs +++ b/mtgott/src/bin/mtgott_cli.rs @@ -10,7 +10,7 @@ use crate::mtgott::runtime::*; use std::rc::Rc; fn usage() -> ! { - eprintln!("Usage: program [-D name value]..."); + eprintln!("Usage: mtgott_cli