From 8eabcc0bb1aac6d164efe35f281a9971b2183791 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Tue, 9 Jul 2024 01:18:18 -0700 Subject: [PATCH 01/13] feat: :hammer: improve devcontainer.json and Dockerfile - uses devcontainer features to install typst instead - uses fnt to install fonts - uses a large library of fonts (can be found at https://fonts.google.com) - fonts can be added via the FNT_FONTS arg in devcontainer.json - installs all available variant for a font - moves font installation into its own images in order to prevent polluting the final product with the tools required for it (woff2_decompress and fnt). This also enables parallelization. - installs the following fonts by default: - carlito (Open source calibri alternative) - firasans - blinker - virgil (used by excalidraw images) --- .devcontainer/Dockerfile | 65 ++++++++++++++++++++++++--------- .devcontainer/devcontainer.json | 14 +++++-- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c49ec2b..200ca36 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,13 +1,44 @@ -FROM mcr.microsoft.com/devcontainers/rust:bullseye +# Install fonts using fnt +FROM alpine:latest as fonts-fnt +# # Get git to clone repos and install fnt's dependencies: chafa +RUN apk add --no-cache git make curl bash -ARG TYPST_VERSION=v0.11.0 -ARG NOTEBOOKiNATOR_VERSION=1.0.1 +# fake otfinfo and chafa as they are only required by fnt for a few commands but are always checked +COPY /usr/bin/otfinfo < Date: Tue, 9 Jul 2024 09:40:29 +0000 Subject: [PATCH 02/13] fix: :rotating_light: fix errors due to formatter goofiness --- .devcontainer/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 200ca36..96cde2a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,12 +4,12 @@ FROM alpine:latest as fonts-fnt RUN apk add --no-cache git make curl bash # fake otfinfo and chafa as they are only required by fnt for a few commands but are always checked -COPY /usr/bin/otfinfo < Date: Wed, 10 Jul 2024 12:29:18 +0000 Subject: [PATCH 03/13] feat: :hammer: add make entry script need to figure out how to reduce boiler plate files (ideally just main.rs), and I need to look into using some sort of config file --- .gitignore | 1 + Cargo.lock | 2326 ++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 3 + main.typ | 4 + script/Cargo.toml | 13 + script/src/main.rs | 373 +++++++ 6 files changed, 2720 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 script/Cargo.toml create mode 100755 script/src/main.rs diff --git a/.gitignore b/.gitignore index a136337..06ca30c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pdf +target \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..f196b50 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2326 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "az" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "biblatex" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27fe7285040d0227cd8b5395e1c4783f44f0b673eca5a657f4432ae401f2b7b8" +dependencies = [ + "numerals", + "paste", + "strum", + "unicode-normalization", + "unscanny", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] + +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + +[[package]] +name = "bytemuck" +version = "1.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chinese-number" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49fccaef6346f6d6a741908d3b79fe97c2debe2fbb5eb3a7d00ff5981b52bb6c" +dependencies = [ + "chinese-variant", + "enum-ordinalize", + "num-bigint", + "num-traits", +] + +[[package]] +name = "chinese-variant" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7588475145507237ded760e52bf2f1085495245502033756d28ea72ade0e498b" + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "citationberg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d259fe9fd78ffa05a119581d20fddb50bfba428311057b12741ffb9015123d0b" +dependencies = [ + "quick-xml 0.31.0", + "serde", +] + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "comemo" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df6916408a724339aa77b18214233355f3eb04c42eb895e5f8909215bd8a7a91" +dependencies = [ + "comemo-macros", + "once_cell", + "parking_lot", + "siphasher 1.0.1", +] + +[[package]] +name = "comemo-macros" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8936e42f9b4f5bdfaf23700609ac1f11cb03ad4c1ec128a4ee4fd0903e228db" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "core_maths" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" +dependencies = [ + "libm", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + +[[package]] +name = "data-url" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "ecow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54bfbb1708988623190a6c4dbedaeaf0f53c20c6395abd6a01feb327b3146f4b" +dependencies = [ + "serde", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fast-srgb8" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" + +[[package]] +name = "fdeflate" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fontdb" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" +dependencies = [ + "log", + "slotmap", + "tinyvec", + "ttf-parser", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "gif" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hayagriva" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d0d20c98b77b86ce737876b2a1653e2e6abbeee84afbb39d72111091191c97a" +dependencies = [ + "biblatex", + "ciborium", + "citationberg", + "indexmap", + "numerals", + "paste", + "serde", + "serde_yaml", + "thiserror", + "unic-langid", + "unicode-segmentation", + "unscanny", + "url", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hypher" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b24ad5637230df201ab1034d593f1d09bf7f2a9274f2e8897638078579f4265" + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "serde", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "serde", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "postcard", + "serde", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_adapters" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6324dfd08348a8e0374a447ebd334044d766b1839bb8d5ccf2482a99a77c0bc" +dependencies = [ + "icu_locid", + "icu_locid_transform", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_provider_blob" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c24b98d1365f55d78186c205817631a4acf08d7a45bdf5dc9dcf9c5d54dccf51" +dependencies = [ + "icu_provider", + "postcard", + "serde", + "writeable", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "icu_segmenter" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a717725612346ffc2d7b42c94b820db6908048f39434504cb130e8b46256b0de" +dependencies = [ + "core_maths", + "displaydoc", + "icu_collections", + "icu_locid", + "icu_provider", + "icu_segmenter_data", + "serde", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_segmenter_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f739ee737260d955e330bc83fdeaaf1631f7fb7ed218761d3c04bb13bb7d79df" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "gif", + "jpeg-decoder", + "num-traits", + "png", +] + +[[package]] +name = "imagesize" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", + "serde", +] + +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + +[[package]] +name = "kamadak-exif" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +dependencies = [ + "mutate_once", +] + +[[package]] +name = "kurbo" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "lipsum" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "636860251af8963cc40f6b4baadee105f02e21b28131d76eba8e40ce84ab8064" +dependencies = [ + "rand", + "rand_chacha", +] + +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +dependencies = [ + "serde", +] + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mutate_once" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "numerals" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25be21376a772d15f97ae789845340a9651d3c4246ff5ebb6a2b35f9c37bd31" + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "palette" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" +dependencies = [ + "approx", + "fast-srgb8", + "libm", + "palette_derive", +] + +[[package]] +name = "palette_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" +dependencies = [ + "by_address", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[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", + "quick-xml 0.32.0", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "embedded-io", + "serde", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "qcms" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edecfcd5d755a5e5d98e24cf43113e7cdaec5a070edd0f6b250c03a573da30fa" + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "roxmltree" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "rustybuzz" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c" +dependencies = [ + "bitflags 2.6.0", + "bytemuck", + "smallvec", + "ttf-parser", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "script" +version = "0.1.0" +dependencies = [ + "crossterm", + "serde", + "serde_json", + "strip-ansi-escapes", + "terminal-menu", + "time", + "typst", +] + +[[package]] +name = "serde" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.120" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simplecss" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a11be7c62927d9427e9f40f3444d5499d868648e2edbc4e2116de69e7ec0e89d" +dependencies = [ + "log", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stacker" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "svgtypes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44e288cd960318917cbd540340968b90becc8bc81f171345d706e7a89d9d70" +dependencies = [ + "kurbo", + "siphasher 0.3.11", +] + +[[package]] +name = "syn" +version = "2.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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", + "fancy-regex", + "flate2", + "fnv", + "once_cell", + "plist", + "regex-syntax", + "serde", + "serde_derive", + "serde_json", + "thiserror", + "walkdir", + "yaml-rust", +] + +[[package]] +name = "terminal-menu" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e7bfe79ce3db25763bc7cb3af8be872a5e74ed2844c5cfcbbacd95c4a4bc8a" +dependencies = [ + "crossterm", + "lazy_static", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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", +] + +[[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.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "serde", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + +[[package]] +name = "two-face" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37bed2135b2459c7eefba72c906d374697eb15949c205f2f124e3636a46b5eeb" +dependencies = [ + "once_cell", + "serde", + "syntect", +] + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typst" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12492297d20937494f0143ae50ef339e5fd3d927b4096af1c52fe73fb9c5fa9a" +dependencies = [ + "az", + "bitflags 2.6.0", + "chinese-number", + "ciborium", + "comemo", + "csv", + "ecow", + "fontdb", + "hayagriva", + "hypher", + "icu_properties", + "icu_provider", + "icu_provider_adapters", + "icu_provider_blob", + "icu_segmenter", + "if_chain", + "image", + "indexmap", + "kamadak-exif", + "kurbo", + "lipsum", + "log", + "once_cell", + "palette", + "phf", + "png", + "portable-atomic", + "qcms", + "rayon", + "regex", + "roxmltree", + "rustybuzz", + "serde", + "serde_json", + "serde_yaml", + "siphasher 1.0.1", + "smallvec", + "stacker", + "syntect", + "time", + "toml", + "ttf-parser", + "two-face", + "typed-arena", + "typst-assets", + "typst-macros", + "typst-syntax", + "typst-timing", + "unicode-bidi", + "unicode-math-class", + "unicode-script", + "unicode-segmentation", + "usvg", + "wasmi", +] + +[[package]] +name = "typst-assets" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b3061f8d268e8eec7481c9ab24540455cb4912983c49aae38fa6e8bf8ef4d9c" + +[[package]] +name = "typst-macros" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a0fdfd46b4920b0f8e4215e5b8438c737e8bc3498a681ea59b0130228363fc" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "typst-syntax" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3db69f2f41613b1ff6edbec44fd7dc524137f099ee36c46f560cedeaadb40c4" +dependencies = [ + "comemo", + "ecow", + "once_cell", + "serde", + "unicode-ident", + "unicode-math-class", + "unicode-script", + "unicode-segmentation", + "unscanny", +] + +[[package]] +name = "typst-timing" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b58e17192bcacb2a39aace6d3eece70f008b2949ce384ac501a58357fafee67" +dependencies = [ + "parking_lot", + "serde", + "serde_json", + "typst-syntax", +] + +[[package]] +name = "unic-langid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" +dependencies = [ + "unic-langid-impl", +] + +[[package]] +name = "unic-langid-impl" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" +dependencies = [ + "serde", + "tinystr", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" + +[[package]] +name = "unicode-ccc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-math-class" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d246cf599d5fae3c8d56e04b20eb519adb89a8af8d0b0fbcded369aa3647d65" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + +[[package]] +name = "unicode-script" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "unscanny" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9df2af067a7953e9c3831320f35c1cc0600c30d44d9f7a12b01db1cd88d6b47" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "usvg" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "377f62b4a3c173de8654c1aa80ab1dac1154e6f13a779a9943e53780120d1625" +dependencies = [ + "base64 0.21.7", + "log", + "pico-args", + "usvg-parser", + "usvg-text-layout", + "usvg-tree", + "xmlwriter", +] + +[[package]] +name = "usvg-parser" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351a05e6f2023d6b4e946f734240a3927aefdcf930d7d42587a2c8a8869814b0" +dependencies = [ + "data-url", + "flate2", + "imagesize", + "kurbo", + "log", + "roxmltree", + "simplecss", + "siphasher 0.3.11", + "svgtypes", + "usvg-tree", +] + +[[package]] +name = "usvg-text-layout" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c41888b9d5cf431fe852eaf9d047bbde83251b98f1749c2f08b1071e6db46e2" +dependencies = [ + "fontdb", + "kurbo", + "log", + "rustybuzz", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "usvg-tree", +] + +[[package]] +name = "usvg-tree" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18863e0404ed153d6e56362c5b1146db9f4f262a3244e3cf2dbe7d8a85909f05" +dependencies = [ + "strict-num", + "svgtypes", + "tiny-skia-path", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vte" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" +dependencies = [ + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasmi" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +dependencies = [ + "smallvec", + "spin", + "wasmi_arena", + "wasmi_core", + "wasmparser-nostd", +] + +[[package]] +name = "wasmi_arena" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" + +[[package]] +name = "wasmi_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + +[[package]] +name = "wasmparser-nostd" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" +dependencies = [ + "indexmap-nostd", +] + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +dependencies = [ + "memchr", +] + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb594dd55d87335c5f60177cee24f19457a5ec10a065e0a3014722ad252d0a1f" +dependencies = [ + "displaydoc", + "litemap", + "serde", + "zerovec", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "serde", + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8db2ac9 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = [ "script" ] +resolver = "2" diff --git a/main.typ b/main.typ index 5ddf5f3..ba4d220 100644 --- a/main.typ +++ b/main.typ @@ -9,8 +9,12 @@ theme: radial-theme, // TODO: change the theme to one you like ) +#text(font: ("Calibri","Carlito"))[BLAH BLAH BLAH DDDDDDDDDD] + #include "./frontmatter.typ" +#lorem(100) + #include "./entries/entries.typ" #include "./appendix.typ" diff --git a/script/Cargo.toml b/script/Cargo.toml new file mode 100644 index 0000000..98d962d --- /dev/null +++ b/script/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "script" +version = "0.1.0" +edition = "2021" + +[dependencies] +crossterm = "0.25.0" +serde = { version = "1.0.204", features = ["derive"] } +serde_json = "1.0.120" +strip-ansi-escapes = "0.2.0" +terminal-menu = "3.0.0" +time = "0.3.36" +typst = "0.11.1" diff --git a/script/src/main.rs b/script/src/main.rs new file mode 100755 index 0000000..92e8dfb --- /dev/null +++ b/script/src/main.rs @@ -0,0 +1,373 @@ +#!/usr/bin/env rust-script + +//! ```cargo +//! [dependencies] +//! crossterm = "0.25.0" +//! serde = { version = "1.0.204", features = ["derive"] } +//! serde_json = "1.0.120" +//! strip-ansi-escapes = "0.2.0" +//! terminal-menu = "3.0.0" +//! time = "0.3.36" +//! typst = "0.11.1" +//! ``` + +extern crate terminal_menu; +extern crate time; +extern crate typst; + +use std::{ + collections::HashMap, + fs, + io::Write, + num::ParseIntError, + process::Command, + sync::{Arc, RwLock}, +}; + +use crossterm::style::{Color, Colored}; +use serde::Deserialize; +use terminal_menu::{ + back_button, button, label, menu, mut_menu, run, scroll, string, submenu, TerminalMenuItem, + TerminalMenuStruct, +}; +use time::{macros::format_description, Date}; +pub struct MenuBuilder { + items: Vec, +} + +impl MenuBuilder { + pub fn add_item(mut self, item: TerminalMenuItem) -> Self { + self.items.push(item); + self + } + pub fn add_button>(self, name: T) -> Self { + self.add_item(button(name)) + } + pub fn add_back_button>(self, name: T) -> Self { + self.add_item(back_button(name)) + } + pub fn add_label>(self, text: T) -> Self { + self.add_item(label(text)) + } + pub fn add_scroll, T2: IntoIterator>(self, name: T, values: T2) -> Self + where + T2::Item: Into, + { + self.add_item(scroll(name, values)) + } + pub fn add_string, T2: Into>( + self, + name: T, + default: T2, + allow_empty: bool, + ) -> Self { + self.add_item(string(name, default, allow_empty)) + } + pub fn add_menu + Clone>(self, name: T, sub_menu_builder: MenuBuilder) -> Self { + self.add_item(submenu(name, sub_menu_builder.items)) + } + pub fn colorize_prev(mut self, color: Color) -> Self { + self.items + .pop() + .and_then(|item: TerminalMenuItem| Some(self.items.push(item.colorize(color)))); + self + } + pub fn build(self: MenuBuilder) -> Arc> { + menu(self.items) + } +} + +fn menu_builder() -> MenuBuilder { + MenuBuilder { items: vec![] } +} + +#[derive(Deserialize, Debug)] +struct NotebookinatorEntryTypeMetadata { + pub data: (Vec,), +} + +#[derive(Deserialize, Debug)] +struct ThemeMetadata(pub String, Option>); + +#[derive(Deserialize, Debug)] +struct EntryTypeMetadata(String, EntryTypeMetadataValue); + +#[derive(Deserialize, Debug)] +#[serde(untagged)] +enum EntryTypeMetadataValue { + ColorString(String), + ColorObject(EntryTypeMetadataObject), +} + +#[derive(Deserialize, Debug)] +struct EntryTypeMetadataObject { + pub color: String, +} +#[derive(Debug, Clone)] +struct EntryType { + name: String, + color: Color, +} + +pub fn decode_hex(s: &str) -> Result, ParseIntError> { + (0..s.len()) + .step_by(2) + .map(|i| u8::from_str_radix(&s[i..i + 2], 16)) + .collect() +} + +impl EntryType { + pub fn from_string_pair((name, color_str): (String, String)) -> Self { + let hex_color = color_str + .trim_start_matches("rgb(\"#") + .trim_end_matches("\")"); + let hex_bytes = decode_hex(hex_color).expect("Failed to parse rgb color string"); + if hex_bytes.len() != 3 { + panic!("rbg color string was not of length 3") + } + EntryType { + name: name, + color: Color::Rgb { + r: *hex_bytes.get(0).unwrap(), + g: *hex_bytes.get(1).unwrap(), + b: *hex_bytes.get(2).unwrap(), + }, + } + } + + pub fn from_string_pairs( + iter: Box>, + ) -> Box> { + Box::new(iter.map(|pair| Self::from_string_pair(pair))) + } +} + +fn query_entry_type_metadata() -> Box> { + let raw_metadata = String::from_utf8( + Command::new("bash") + .arg("-c") + .arg( + "typst query - '' --field value < { + let entry-metadata = dictionary(theme.components).pairs().find(( + (key, _value), + ) => key == \"entry-type-metadata\") + if (entry-metadata == none) { + return (name, entry-metadata) + } + return (name, entry-metadata.at(1).pairs()) + }), +) +EOF", + ) + .output() + .expect("failed to query typst for entry-type-metadata") + .stdout, + ) + .unwrap(); + let wrapped_metadata = format!("{{ \"data\": {} }}", raw_metadata); + let deserialized_metadata: NotebookinatorEntryTypeMetadata = + serde_json::de::from_str(&wrapped_metadata).expect("failed to parse metadata"); + let theme_entries_map: HashMap> = deserialized_metadata + .data + .0 + .into_iter() + .filter_map( + |theme: ThemeMetadata| -> Option<(String, Vec<(String, String)>)> { + let theme_name = theme.0; + let entry_types = theme.1; + return entry_types.and_then(|entry_types: Vec| { + Some(( + theme_name, + entry_types + .into_iter() + .map(|entry_type| -> (String, String) { + let entry_name = entry_type.0; + let color: String = match entry_type.1 { + EntryTypeMetadataValue::ColorString(str) => str, + EntryTypeMetadataValue::ColorObject( + EntryTypeMetadataObject { color }, + ) => color, + }; + (entry_name, color) + }) + .collect(), + )) + }); + }, + ) + .collect(); + use typst::syntax::{ + ast::{ + Arg::Named, + AstNode, + Expr::{FieldAccess, FuncCall, Show}, + Markup, + }, + parse, + }; + + // attempt to get the theme from ./main.typ + let contents = fs::read_to_string("./main.typ").expect("Failed to read ./main.typ"); + let untyped_ast = parse(contents.as_str()); + let ast = Markup::from_untyped(&untyped_ast).expect("Failed to parse ./main.typ's AST"); + let themes = ast + .exprs() + .filter_map(|expr| match expr { + Show(show_rule) => Some(show_rule.transform()), + _ => None, + }) + .filter_map(|expr| match expr { + FuncCall(func_call) => Some(func_call), + _ => None, + }) + .filter(|func| match func.callee() { + FieldAccess(field_access) => field_access.target().to_untyped().text() == "notebook", + _ => false, + }) + .map(|func| { + func.args() + .items() + .into_iter() + .filter_map(|arg| match arg { + Named(named_arg) => Some(named_arg), + _ => None, + }) + .filter(|arg| arg.name().as_str() == "theme") + .map(|arg| arg.expr().to_untyped().to_owned().into_text()) + }) + .flatten(); + for user_theme in themes { + for (theme, entries) in theme_entries_map.iter() { + if user_theme.contains(theme) { + return EntryType::from_string_pairs(Box::new(entries.to_owned().into_iter())); + } + } + } + let default_theme = theme_entries_map + .get_key_value("radial") + .or_else(|| theme_entries_map.iter().next()) + .expect("Failed to find any themes with entry types in notebookinator"); + eprintln!( + "Could not find theme in ./main.typ, defaulting to {}.", + default_theme.0 + ); + return EntryType::from_string_pairs(Box::new(default_theme.1.to_owned().into_iter())); +} + +fn make_date_time_str(date: time::Date) -> String { + date.format(format_description!( + "datetime(year: [year], month: [month], day: [day])" + )) + .expect("Failed to parse date") +} + +fn main() { + let entry_types = query_entry_type_metadata(); + let entry_types_vec: Vec = entry_types.collect(); + let date_format_description = format_description!("[year]-[month]-[day]"); + let todays_date = time::OffsetDateTime::now_utc(); + let todays_date_str = todays_date.format(&date_format_description).unwrap(); + // let mut entry_type_sub_menu = menu_builder(); + // for entry_type in query_entry_type_metadata() + let my_menu = menu_builder() + .add_label("-----------------") + .add_label("Make a new entry!") + .add_label("-----------------") + .add_scroll("section", vec!["body", "frontmatter", "appendix"]) + .add_string("title", "", false) + .add_scroll( + "type", + entry_types_vec.iter().map(|e| { + format!("\x1B[{}m", Colored::ForegroundColor(e.color).to_string()) + e.name.as_str() + }), + ) + .add_string("date", todays_date_str, false) + .add_string( + "author", + Command::new("git") + .arg("config") + .arg("--get") + .arg("user.name") + .output() + .and_then(|output| { + Ok(String::from( + String::from_utf8(output.stdout) + .unwrap_or(String::new()) + .trim(), + )) + }) + .unwrap_or(String::new()), + false, + ) + .add_string("witness", "", true) + .add_button("enter!") + .colorize_prev(Color::Green) + .build(); + + run(&my_menu); + let my_mut_menu = mut_menu(&my_menu); + + let date = Date::parse( + my_mut_menu.selection_value("date"), + &date_format_description, + ) + .unwrap_or(todays_date.date()); + let date_string = make_date_time_str(date); + let date_str = date_string.as_str(); + let title = my_mut_menu.selection_value("title"); + let section = my_mut_menu.selection_value("section"); + let entry_type_string = String::from_utf8(strip_ansi_escapes::strip( + my_mut_menu.selection_value("type"), + )) + .unwrap(); + let entry_type = entry_type_string.as_str(); + let author = my_mut_menu.selection_value("author"); + let witness = my_mut_menu.selection_value("witness"); + + let entry_content = format!( + "#import \"/packages.typ\": * +#import components: * +// TODO: add comment +#show: create-entry.with( + section: \"{section}\", + title: \"{title}\", + type: \"{entry_type}\", + date: {date_str}, + author: \"{author}\", + witness: \"{witness}\", +)" + ); + let entry_file_name = title.to_lowercase().replace(" ", "_"); + fs::DirBuilder::new() + .create(format!("./entries/{}", entry_file_name)) + .expect("failed to make entry directory"); + let entry_file_path = &format!("./entries/{}/{}.typ", entry_file_name, entry_file_name); + let mut entry_file = + fs::File::create_new(entry_file_path).expect("failed to make entry typst file"); + entry_file + .write_all(entry_content.as_bytes()) + .expect("failed to write to entry typst file"); + entry_file + .flush() + .expect("failed to flush to entry typst file"); + + let mut entries_file = fs::File::options() + .append(true) + .open("./entries/entries.typ") + .expect("failed to open ./entries/entries.typ"); + entries_file + .write_all( + format!( + "\n\n#include \"{}\"", + entry_file_path.trim_start_matches(".") + ) + .as_bytes(), + ) + .expect("failed to write to ./entries/entries.typ"); + entries_file + .flush() + .expect("failed to flush to ./entries/entries.typ"); +} From 81b794724683a62b4a494c9903bd3d0a467000f2 Mon Sep 17 00:00:00 2001 From: meisZWFLZ Date: Thu, 11 Jul 2024 04:29:21 +0000 Subject: [PATCH 04/13] refactor: :truck: script -> scripts/add-entry --- Cargo.toml | 2 +- {script => scripts/add-entry}/Cargo.toml | 0 {script => scripts/add-entry}/src/main.rs | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename {script => scripts/add-entry}/Cargo.toml (100%) rename {script => scripts/add-entry}/src/main.rs (100%) mode change 100755 => 100644 diff --git a/Cargo.toml b/Cargo.toml index 8db2ac9..f27277f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = [ "script" ] +members = [ "scripts/add-entry" ] resolver = "2" diff --git a/script/Cargo.toml b/scripts/add-entry/Cargo.toml similarity index 100% rename from script/Cargo.toml rename to scripts/add-entry/Cargo.toml diff --git a/script/src/main.rs b/scripts/add-entry/src/main.rs old mode 100755 new mode 100644 similarity index 100% rename from script/src/main.rs rename to scripts/add-entry/src/main.rs From 2df9c3c4c9f4144ffd4940ed85f01d9a659d8659 Mon Sep 17 00:00:00 2001 From: meisZWFLZ Date: Thu, 11 Jul 2024 05:02:48 -0700 Subject: [PATCH 05/13] fix: :bug: fix cargo not working as vscode --- .devcontainer/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 96cde2a..e9e38ee 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -40,14 +40,14 @@ RUN rm Virgil.woff2 # Create final product FROM mcr.microsoft.com/devcontainers/rust:bullseye as final -# Install typst-live -RUN cargo install typst-live -ENV PATH="/root/.cargo/bin:${PATH}" - # We need to change the user here because typst local packages are installed per user USER vscode WORKDIR /home/vscode/ +# We need to install typst-live after changing users, otherwise, vscode doesn't have the necessary permissions to +# Install typst-live +RUN cargo install typst-live + # ARG TYPST_VERSION=v0.11.0 ARG NOTEBOOKiNATOR_VERSION=patch-1 # Install the notebookinator From d2475142ead444e8c23151ca80ac21b23a7981a8 Mon Sep 17 00:00:00 2001 From: meisZWFLZ Date: Thu, 11 Jul 2024 05:06:16 -0700 Subject: [PATCH 06/13] feat: :sparkles: improve input parsing - use dateparser to parse dates in a variety of formats - make nested directories if '/' is present in title input --- Cargo.lock | 199 +++++++++++++++++++++++++++++++++- scripts/add-entry/Cargo.toml | 4 +- scripts/add-entry/src/main.rs | 120 +++++++++++++------- 3 files changed, 283 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f196b50..daf2669 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,27 @@ dependencies = [ "memchr", ] +[[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 = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + [[package]] name = "approx" version = "0.5.1" @@ -114,6 +135,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "by_address" version = "1.2.1" @@ -162,6 +189,42 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7588475145507237ded760e52bf2f1085495245502033756d28ea72ade0e498b" +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.6", +] + +[[package]] +name = "chrono-tz" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + [[package]] name = "ciborium" version = "0.2.2" @@ -234,6 +297,12 @@ dependencies = [ "syn", ] +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + [[package]] name = "core_maths" version = "0.1.0" @@ -335,6 +404,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "dateparser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ef451feee09ae5ecd8a02e738bd9adee9266b8fa9b44e22d3ce968d8694238" +dependencies = [ + "anyhow", + "chrono", + "lazy_static", + "regex", +] + [[package]] name = "deranged" version = "0.3.11" @@ -541,6 +622,29 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b24ad5637230df201ab1034d593f1d09bf7f2a9274f2e8897638078579f4265" +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "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 = "icu_collections" version = "1.5.0" @@ -755,6 +859,15 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "kamadak-exif" version = "0.5.5" @@ -959,6 +1072,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + [[package]] name = "paste" version = "1.0.15" @@ -981,6 +1103,16 @@ dependencies = [ "phf_shared", ] +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + [[package]] name = "phf_generator" version = "0.11.2" @@ -1262,12 +1394,14 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" name = "script" version = "0.1.0" dependencies = [ + "chrono", + "chrono-tz", "crossterm", + "dateparser", "serde", "serde_json", "strip-ansi-escapes", "terminal-menu", - "time", "typst", ] @@ -1999,6 +2133,60 @@ 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.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + [[package]] name = "wasmi" version = "0.31.2" @@ -2076,6 +2264,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/scripts/add-entry/Cargo.toml b/scripts/add-entry/Cargo.toml index 98d962d..184b2a4 100644 --- a/scripts/add-entry/Cargo.toml +++ b/scripts/add-entry/Cargo.toml @@ -4,10 +4,12 @@ version = "0.1.0" edition = "2021" [dependencies] +chrono = "0.4.38" +chrono-tz = "0.9.0" crossterm = "0.25.0" +dateparser = "0.2.1" serde = { version = "1.0.204", features = ["derive"] } serde_json = "1.0.120" strip-ansi-escapes = "0.2.0" terminal-menu = "3.0.0" -time = "0.3.36" typst = "0.11.1" diff --git a/scripts/add-entry/src/main.rs b/scripts/add-entry/src/main.rs index 92e8dfb..5534d59 100644 --- a/scripts/add-entry/src/main.rs +++ b/scripts/add-entry/src/main.rs @@ -3,24 +3,33 @@ //! ```cargo //! [dependencies] //! crossterm = "0.25.0" +//! chrono = "0.4.38" +//! chrono-tz = "0.9.0" +//! crossterm = "0.25.0" +//! dateparser = "0.2.1" //! serde = { version = "1.0.204", features = ["derive"] } //! serde_json = "1.0.120" //! strip-ansi-escapes = "0.2.0" //! terminal-menu = "3.0.0" -//! time = "0.3.36" //! typst = "0.11.1" //! ``` +extern crate chrono; +extern crate chrono_tz; +extern crate dateparser; extern crate terminal_menu; -extern crate time; extern crate typst; +use chrono::{offset::Local, TimeZone}; + use std::{ collections::HashMap, + env::consts::OS, fs, io::Write, num::ParseIntError, process::Command, + str::FromStr, sync::{Arc, RwLock}, }; @@ -30,7 +39,7 @@ use terminal_menu::{ back_button, button, label, menu, mut_menu, run, scroll, string, submenu, TerminalMenuItem, TerminalMenuStruct, }; -use time::{macros::format_description, Date}; + pub struct MenuBuilder { items: Vec, } @@ -144,10 +153,14 @@ impl EntryType { fn query_entry_type_metadata() -> Box> { let raw_metadata = String::from_utf8( - Command::new("bash") - .arg("-c") - .arg( - "typst query - '' --field value <' --field value < { @@ -161,10 +174,10 @@ fn query_entry_type_metadata() -> Box> { }), ) EOF", - ) - .output() - .expect("failed to query typst for entry-type-metadata") - .stdout, + ) + .output() + .expect("failed to query typst for entry-type-metadata") + .stdout, ) .unwrap(); let wrapped_metadata = format!("{{ \"data\": {} }}", raw_metadata); @@ -257,19 +270,16 @@ EOF", return EntryType::from_string_pairs(Box::new(default_theme.1.to_owned().into_iter())); } -fn make_date_time_str(date: time::Date) -> String { - date.format(format_description!( - "datetime(year: [year], month: [month], day: [day])" - )) - .expect("Failed to parse date") +fn make_date_time_str(date: chrono::DateTime) -> String { + date.format("datetime(year: %Y, month: %m, day: %d)") + .to_string() } -fn main() { +fn main() -> Result<(), String> { let entry_types = query_entry_type_metadata(); let entry_types_vec: Vec = entry_types.collect(); - let date_format_description = format_description!("[year]-[month]-[day]"); - let todays_date = time::OffsetDateTime::now_utc(); - let todays_date_str = todays_date.format(&date_format_description).unwrap(); + let todays_date = chrono::Local::now(); + let todays_date_str = todays_date.format("%F").to_string(); // let mut entry_type_sub_menu = menu_builder(); // for entry_type in query_entry_type_metadata() let my_menu = menu_builder() @@ -310,14 +320,18 @@ fn main() { run(&my_menu); let my_mut_menu = mut_menu(&my_menu); - let date = Date::parse( - my_mut_menu.selection_value("date"), - &date_format_description, - ) - .unwrap_or(todays_date.date()); + let date = dateparser::parse_with_timezone(my_mut_menu.selection_value("date"), &Local) + .ok() + .and_then(|date| Local.from_local_datetime(&date.naive_local()).earliest()) + .or_else(|| { + eprintln!("failed to parse date!"); + None + }) + .unwrap_or(todays_date); let date_string = make_date_time_str(date); let date_str = date_string.as_str(); - let title = my_mut_menu.selection_value("title"); + let title_input = my_mut_menu.selection_value("title"); + let title = title_input.split('/').last().unwrap(); let section = my_mut_menu.selection_value("section"); let entry_type_string = String::from_utf8(strip_ansi_escapes::strip( my_mut_menu.selection_value("type"), @@ -327,6 +341,10 @@ fn main() { let author = my_mut_menu.selection_value("author"); let witness = my_mut_menu.selection_value("witness"); + if title.len() == 0 { + return Err(String::from_str("title must be specified!").unwrap()); + }; + let entry_content = format!( "#import \"/packages.typ\": * #import components: * @@ -340,24 +358,48 @@ fn main() { witness: \"{witness}\", )" ); - let entry_file_name = title.to_lowercase().replace(" ", "_"); - fs::DirBuilder::new() - .create(format!("./entries/{}", entry_file_name)) - .expect("failed to make entry directory"); - let entry_file_path = &format!("./entries/{}/{}.typ", entry_file_name, entry_file_name); - let mut entry_file = - fs::File::create_new(entry_file_path).expect("failed to make entry typst file"); + + let entry_dir_path = "./entries/".to_owned() + + (title_input + .to_lowercase() + .replace(" ", "_") + .trim_end_matches("/")); + let entry_file_path_vec: Vec<&str> = entry_dir_path.split("/").collect(); + let entry_file_name = entry_file_path_vec.last().unwrap(); + { + let mut new_dir_path = String::from_str(entry_file_path_vec.first().unwrap()).unwrap(); + for path_part in entry_file_path_vec.iter().skip(1) { + new_dir_path += "/"; + new_dir_path += path_part; + + fs::create_dir(new_dir_path.clone()) + .or_else(|err| { + if err.kind() == std::io::ErrorKind::AlreadyExists { + Ok(()) + } else { + Err(err) + } + }) + .expect( + format!("Failed to make part of entry directory: ({})", new_dir_path).as_str(), + ); + } + } + + let entry_file_path = &format!("{}/{}.typ", entry_dir_path, entry_file_name); + let mut entry_file = fs::File::create_new(entry_file_path) + .expect(format!("Failed to make entry typst file ({})", entry_file_path).as_str()); entry_file .write_all(entry_content.as_bytes()) - .expect("failed to write to entry typst file"); + .expect("Failed to write to entry typst file"); entry_file .flush() - .expect("failed to flush to entry typst file"); + .expect("Failed to flush to entry typst file"); let mut entries_file = fs::File::options() .append(true) .open("./entries/entries.typ") - .expect("failed to open ./entries/entries.typ"); + .expect("Failed to open ./entries/entries.typ"); entries_file .write_all( format!( @@ -366,8 +408,10 @@ fn main() { ) .as_bytes(), ) - .expect("failed to write to ./entries/entries.typ"); + .expect("Failed to write to ./entries/entries.typ"); entries_file .flush() - .expect("failed to flush to ./entries/entries.typ"); + .expect("Failed to flush to ./entries/entries.typ"); + + Ok(()) } From 0acaaa2b781df3c2da9815126b6c5989bb5d6161 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:18:52 -0700 Subject: [PATCH 07/13] feat: :sparkles: install add-entry script in dockerfile --- .devcontainer/Dockerfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e9e38ee..56f80fc 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -37,6 +37,16 @@ RUN wget https://virgil.excalidraw.com/Virgil.woff2 -O ./Virgil.woff2 RUN woff2_decompress Virgil.woff2 RUN rm Virgil.woff2 +# create add-entry binary +FROM rust:1-bullseye as add-entry-binary +COPY scripts scripts +RUN cargo install --root /usr/local/cargo/ --path ./scripts/add-entry + +# create typst-live binary +FROM rust:1-bullseye as typst-live-binary + +RUN cargo install --root /usr/local/cargo/ typst-live + # Create final product FROM mcr.microsoft.com/devcontainers/rust:bullseye as final @@ -44,17 +54,15 @@ FROM mcr.microsoft.com/devcontainers/rust:bullseye as final USER vscode WORKDIR /home/vscode/ -# We need to install typst-live after changing users, otherwise, vscode doesn't have the necessary permissions to -# Install typst-live -RUN cargo install typst-live - -# ARG TYPST_VERSION=v0.11.0 -ARG NOTEBOOKiNATOR_VERSION=patch-1 +ARG NOTEBOOKINATOR_VERSION=1.0.1 +ARG NOTEBOOKINATOR_REPO=https://github.com/The-Notebookinator/notebookinator.git # Install the notebookinator -RUN git clone --depth 1 --branch ${NOTEBOOKiNATOR_VERSION} https://github.com/meisZWFLZ/notebookinator.git && \ +RUN git clone --depth 1 --branch ${NOTEBOOKINATOR_VERSION} ${NOTEBOOKINATOR_REPO} notebookinator && \ ./notebookinator/scripts/package @local && \ rm -rf notebookinator # install fonts COPY --from=fonts-fnt /fonts/* /usr/local/share/fonts/ COPY --from=fonts-virgil /Virgil.ttf /usr/local/share/fonts/ +COPY --from=typst-live-binary /usr/local/cargo/bin/* /usr/local/cargo/bin/ +COPY --from=add-entry-binary /usr/local/cargo/bin/* /usr/local/cargo/bin/ From cf4385c7c9b01be48b4e48e2685a7526ffb65271 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:21:52 -0700 Subject: [PATCH 08/13] perf: :heavy_minus_sign: remove strip-ansi-escapes also renames add-entry package to add-entry --- Cargo.lock | 64 ++++++++--------------------------- scripts/add-entry/Cargo.toml | 3 +- scripts/add-entry/src/main.rs | 23 ++++++++++--- 3 files changed, 33 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index daf2669..e2b71ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,20 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "add-entry" +version = "0.1.0" +dependencies = [ + "chrono", + "chrono-tz", + "crossterm", + "dateparser", + "serde", + "serde_json", + "terminal-menu", + "typst", +] + [[package]] name = "adler" version = "1.0.2" @@ -1390,21 +1404,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "script" -version = "0.1.0" -dependencies = [ - "chrono", - "chrono-tz", - "crossterm", - "dateparser", - "serde", - "serde_json", - "strip-ansi-escapes", - "terminal-menu", - "typst", -] - [[package]] name = "serde" version = "1.0.204" @@ -1564,15 +1563,6 @@ dependencies = [ "float-cmp", ] -[[package]] -name = "strip-ansi-escapes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" -dependencies = [ - "vte", -] - [[package]] name = "strum" version = "0.26.3" @@ -2085,38 +2075,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "vte" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" -dependencies = [ - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte_generate_state_changes" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" -dependencies = [ - "proc-macro2", - "quote", -] - [[package]] name = "walkdir" version = "2.5.0" diff --git a/scripts/add-entry/Cargo.toml b/scripts/add-entry/Cargo.toml index 184b2a4..8b8a910 100644 --- a/scripts/add-entry/Cargo.toml +++ b/scripts/add-entry/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "script" +name = "add-entry" version = "0.1.0" edition = "2021" @@ -10,6 +10,5 @@ crossterm = "0.25.0" dateparser = "0.2.1" serde = { version = "1.0.204", features = ["derive"] } serde_json = "1.0.120" -strip-ansi-escapes = "0.2.0" terminal-menu = "3.0.0" typst = "0.11.1" diff --git a/scripts/add-entry/src/main.rs b/scripts/add-entry/src/main.rs index 5534d59..2b0a850 100644 --- a/scripts/add-entry/src/main.rs +++ b/scripts/add-entry/src/main.rs @@ -275,6 +275,22 @@ fn make_date_time_str(date: chrono::DateTime) -> String { .to_string() } +fn strip_ansi_color_escapes(s: &str) -> String { + let csi = "\x1B["; + s.split(csi) + .enumerate() + .map(|(i, e)| { + if i == 0 { + e + } else { + e.split_once("m") + .and_then(|(_ansi_color, content)| Some(content)) + .unwrap_or(e) + } + }) + .collect() +} + fn main() -> Result<(), String> { let entry_types = query_entry_type_metadata(); let entry_types_vec: Vec = entry_types.collect(); @@ -333,11 +349,8 @@ fn main() -> Result<(), String> { let title_input = my_mut_menu.selection_value("title"); let title = title_input.split('/').last().unwrap(); let section = my_mut_menu.selection_value("section"); - let entry_type_string = String::from_utf8(strip_ansi_escapes::strip( - my_mut_menu.selection_value("type"), - )) - .unwrap(); - let entry_type = entry_type_string.as_str(); + let entry_typed_string = strip_ansi_color_escapes(my_mut_menu.selection_value("type")); + let entry_type = entry_typed_string.as_str(); let author = my_mut_menu.selection_value("author"); let witness = my_mut_menu.selection_value("witness"); From a176a3809f5a80ec782e2c7b846d423e7f097983 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:22:44 -0700 Subject: [PATCH 09/13] feat: :sparkles: add excalidraw vscode extension --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0e2b9db..7f045d9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,8 @@ "vscode": { "extensions": [ "nvarner.typst-lsp", - "mathematic.vscode-pdf" + "mathematic.vscode-pdf", + "pomdtr.excalidraw-editor" ] } }, From 6d46e85d9490737fdee262dd5d6ab75786e3dd89 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:25:06 -0700 Subject: [PATCH 10/13] feat: :sparkles: auto update packages.typ automatically updates package.typ upon container creation to the currently installed version of notebookinator --- .devcontainer/devcontainer.json | 1 + scripts/prepare.sh | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 scripts/prepare.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7f045d9..b77c5c4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,6 +16,7 @@ ] } }, + "updateContentCommand": "./scripts/prepare.sh", "features": { "ghcr.io/michidk/devcontainers-features/typst:1": { "version": "0.11.0" diff --git a/scripts/prepare.sh b/scripts/prepare.sh new file mode 100644 index 0000000..9ab817c --- /dev/null +++ b/scripts/prepare.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# This script is run inside the container whenever new content is available +# in the source tree during the creation process. +# See updateContentCommand: https://containers.dev/implementors/json_reference/#lifecycle-scripts + +# sets packages.typ to the installed version of notebookinator +sed -Ei packages.typ \ + -e "s%@local/notebookinator:[0-9]+\.[0-9]+\.[0-9]+%@local/notebookinator:$( + ls ~/.local/share/typst/packages/local/notebookinator/ | head + )%" From 12d7ebdc212d6ffef2f127bdcd8449b6807dae86 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:25:41 -0700 Subject: [PATCH 11/13] revert: :fire: remove silly testing code --- main.typ | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main.typ b/main.typ index ba4d220..5ddf5f3 100644 --- a/main.typ +++ b/main.typ @@ -9,12 +9,8 @@ theme: radial-theme, // TODO: change the theme to one you like ) -#text(font: ("Calibri","Carlito"))[BLAH BLAH BLAH DDDDDDDDDD] - #include "./frontmatter.typ" -#lorem(100) - #include "./entries/entries.typ" #include "./appendix.typ" From 2cf557a1091217e19eecb2e50af7eab9dc33e28f Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:26:20 -0700 Subject: [PATCH 12/13] feat: :sparkles: open new entries in vscode --- scripts/add-entry/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/add-entry/src/main.rs b/scripts/add-entry/src/main.rs index 2b0a850..27e202b 100644 --- a/scripts/add-entry/src/main.rs +++ b/scripts/add-entry/src/main.rs @@ -426,5 +426,11 @@ fn main() -> Result<(), String> { .flush() .expect("Failed to flush to ./entries/entries.typ"); + // open the entry in vscode + Command::new("code") + .arg("-r") + .arg(entry_file_path) + .spawn() + .unwrap(); Ok(()) } From 3f974e144a9c47507bf1eed16cb2eca199b7d707 Mon Sep 17 00:00:00 2001 From: Andrew Curtis <80860310+meisZWFLZ@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:28:43 -0700 Subject: [PATCH 13/13] feat: :goal_net: improve entry type query error handling --- scripts/add-entry/src/main.rs | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/scripts/add-entry/src/main.rs b/scripts/add-entry/src/main.rs index 27e202b..2fdc7cf 100644 --- a/scripts/add-entry/src/main.rs +++ b/scripts/add-entry/src/main.rs @@ -152,15 +152,14 @@ impl EntryType { } fn query_entry_type_metadata() -> Box> { - let raw_metadata = String::from_utf8( - Command::new(if OS == "windows" { - "C:\\Program Files\\Git\\usr\\bin\\bash.exe" - } else { - "bash" - }) - .arg("-c") - .arg( - "typst query - '' --field value <' --field value < { @@ -174,15 +173,30 @@ fn query_entry_type_metadata() -> Box> { }), ) EOF", - ) - .output() - .expect("failed to query typst for entry-type-metadata") - .stdout, ) - .unwrap(); + .output() + .inspect_err(|e| eprint!("typst query command failed: {:?}", e)) + .expect("failed to retrieve entry type metadata from notebookinator!"); + let raw_metadata = String::from_utf8(raw_metadata_output.stdout).unwrap(); + let raw_metadata_output_stderr = String::from_utf8(raw_metadata_output.stderr).unwrap(); + if raw_metadata.len() == 0 { + panic!( + "Failed to retrieve entry type metadata from notebookinator!: {}", + raw_metadata_output_stderr + ) + } let wrapped_metadata = format!("{{ \"data\": {} }}", raw_metadata); let deserialized_metadata: NotebookinatorEntryTypeMetadata = - serde_json::de::from_str(&wrapped_metadata).expect("failed to parse metadata"); + serde_json::de::from_str(&wrapped_metadata) + .inspect_err(|e| { + panic!( + "failed to parse entry type metadata from notebookinator: + error: {:?} + metadata: {:?}", + e, wrapped_metadata + ) + }) + .unwrap(); let theme_entries_map: HashMap> = deserialized_metadata .data .0