diff --git a/Cargo.lock b/Cargo.lock index 0aa2789..f2649b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,11 +17,74 @@ 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 = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "argus-cli" @@ -29,7 +92,7 @@ version = "0.1.6" dependencies = [ "anyhow", "argus-lib", - "clap", + "clap 3.2.25", "env_logger 0.9.3", "fluid-let", "log", @@ -68,7 +131,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -85,6 +148,44 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" + +[[package]] +name = "bytecount" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" + [[package]] name = "camino" version = "1.1.6" @@ -116,26 +217,77 @@ dependencies = [ "serde_json", ] +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.4", +] + [[package]] name = "clap" version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "bitflags", + "bitflags 1.3.2", "clap_derive", - "clap_lex", + "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", "textwrap", ] +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.0", + "strsim", + "terminal_size", +] + +[[package]] +name = "clap_complete" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c" +dependencies = [ + "clap 4.5.4", +] + [[package]] name = "clap_derive" version = "3.2.25" @@ -158,12 +310,94 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[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.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "either" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" version = "0.9.3" @@ -183,6 +417,23 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", "log", ] @@ -192,12 +443,38 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + [[package]] name = "fluid-let" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getopts" version = "0.2.21" @@ -218,6 +495,20 @@ dependencies = [ "wasi", ] +[[package]] +name = "handlebars" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -245,12 +536,50 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +[[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 = "index_vec" version = "0.1.3" @@ -290,11 +619,22 @@ dependencies = [ "smallvec", ] +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -305,6 +645,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[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 = "kernel32-sys" version = "0.2.2" @@ -327,30 +676,196 @@ version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "mdbook" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c33564061c3c640bed5ace7d6a2a1b65f2c64257d1ac930c15e94ed0fb561d3" +dependencies = [ + "anyhow", + "chrono", + "clap 4.5.4", + "clap_complete", + "env_logger 0.11.2", + "handlebars", + "log", + "memchr", + "once_cell", + "opener", + "pulldown-cmark", + "regex", + "serde", + "serde_json", + "shlex", + "tempfile", + "toml 0.5.11", + "topological-sort", +] + +[[package]] +name = "mdbook-argus" +version = "0.1.0" +dependencies = [ + "anyhow", + "html-escape", + "mdbook-preprocessor-utils", + "nom", + "nom_locate", + "rayon", + "serde", + "serde_json", + "tempfile", + "toml 0.8.12", +] + +[[package]] +name = "mdbook-preprocessor-utils" +version = "0.1.6" +dependencies = [ + "anyhow", + "chrono", + "clap 3.2.25", + "env_logger 0.10.2", + "html-escape", + "log", + "mdbook", + "rayon", + "semver", + "serde", + "serde_json", +] + [[package]] name = "memchr" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom_locate" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e3c83c053b0713da60c5b8de47fe8e494fe3ece5267b2f23090a07a053ba8f3" +dependencies = [ + "bytecount", + "memchr", + "nom", +] + +[[package]] +name = "normpath" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "opener" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" +dependencies = [ + "bstr", + "normpath", + "winapi 0.3.9", +] + [[package]] name = "os_str_bytes" version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +[[package]] +name = "pest" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pest_meta" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -390,6 +905,24 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pulldown-cmark" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0530d13d87d1f549b66a3e8d0c688952abe5994e204ed62615baaf25dc029c" +dependencies = [ + "bitflags 2.5.0", + "memchr", + "pulldown-cmark-escape", + "unicase", +] + +[[package]] +name = "pulldown-cmark-escape" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b" + [[package]] name = "quote" version = "1.0.35" @@ -429,6 +962,26 @@ dependencies = [ "getrandom", ] +[[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 = "regex" version = "1.10.3" @@ -469,7 +1022,7 @@ dependencies = [ "rustc_tools_util", "serde", "serde_json", - "toml", + "toml 0.7.8", ] [[package]] @@ -492,6 +1045,19 @@ dependencies = [ "ts-rs", ] +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" version = "1.0.16" @@ -509,18 +1075,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -529,9 +1095,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -547,12 +1113,35 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "smallvec" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -575,6 +1164,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "term" version = "0.2.14" @@ -594,6 +1195,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "test-log" version = "0.2.14" @@ -651,6 +1262,15 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.7.8" @@ -660,7 +1280,19 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.9", ] [[package]] @@ -682,9 +1314,28 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.34", ] +[[package]] +name = "toml_edit" +version = "0.22.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +dependencies = [ + "indexmap 2.2.3", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.5", +] + +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + [[package]] name = "ts-rs" version = "7.1.1" @@ -709,6 +1360,27 @@ dependencies = [ "termcolor", ] +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-ident" version = "1.0.12" @@ -721,6 +1393,18 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.7.0" @@ -744,6 +1428,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 2.0.48", + "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 2.0.48", + "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 = "winapi" version = "0.2.8" @@ -787,6 +1525,147 @@ 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.4", +] + +[[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.4", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "winnow" version = "0.5.34" @@ -795,3 +1674,12 @@ checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] + +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] diff --git a/Cargo.toml b/Cargo.toml index 68a0009..a551b82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,5 +3,5 @@ members = [ "crates/*" ] exclude = [ "crates/argus_cli/tests/workspaces", "examples" ] resolver = "2" -[profile.dev.package.similar] -opt-level = 3 +[patch.crates-io] +mdbook-preprocessor-utils = { path = "../mdbook-preprocessor-utils" } \ No newline at end of file diff --git a/crates/mdbook-argus/.gitignore b/crates/mdbook-argus/.gitignore new file mode 100644 index 0000000..0b2fbe6 --- /dev/null +++ b/crates/mdbook-argus/.gitignore @@ -0,0 +1 @@ +js/ \ No newline at end of file diff --git a/crates/mdbook-argus/Cargo.toml b/crates/mdbook-argus/Cargo.toml new file mode 100644 index 0000000..27ec174 --- /dev/null +++ b/crates/mdbook-argus/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "mdbook-argus" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = "1.0.81" +html-escape = "0.2.13" +mdbook-preprocessor-utils = "0.1.6" +nom = "7.1.3" +nom_locate = "4.2.0" +rayon = "1.10.0" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +tempfile = "3.10.1" +toml = "0.8.12" + +[build-dependencies] +anyhow = "1.0.81" +mdbook-preprocessor-utils = "0.1.6" diff --git a/crates/mdbook-argus/build.rs b/crates/mdbook-argus/build.rs new file mode 100644 index 0000000..0350f0b --- /dev/null +++ b/crates/mdbook-argus/build.rs @@ -0,0 +1,10 @@ +use std::path::Path; + +use anyhow::Result; + +const SRC_DIR: &str = "../../ide/packages/panoptes/dist/"; +const DST_DIR: &str = "./js"; + +fn main() -> Result<()> { + mdbook_preprocessor_utils::copy_assets(Path::new(SRC_DIR), Path::new(DST_DIR)) +} diff --git a/crates/mdbook-argus/rust-toolchain.toml b/crates/mdbook-argus/rust-toolchain.toml new file mode 120000 index 0000000..e01fe10 --- /dev/null +++ b/crates/mdbook-argus/rust-toolchain.toml @@ -0,0 +1 @@ +../../rust-toolchain.toml \ No newline at end of file diff --git a/crates/mdbook-argus/src/block.rs b/crates/mdbook-argus/src/block.rs new file mode 100644 index 0000000..34597a0 --- /dev/null +++ b/crates/mdbook-argus/src/block.rs @@ -0,0 +1,80 @@ +//! Parser for Argus code blocks within Markdown. + +use std::{hash::Hash, ops::Range}; + +use nom::{ + branch::alt, + bytes::complete::{tag, take_until}, + character::complete::{anychar, char, none_of}, + combinator::map, + multi::many0, + sequence::{preceded, separated_pair, tuple}, + IResult, +}; +use nom_locate::LocatedSpan; + +#[derive(PartialEq, Hash, Debug, Clone)] +pub struct ArgusBlock { + pub config: Vec<(String, String)>, + pub code: String, +} + +impl ArgusBlock { + fn parse(i: LocatedSpan<&str>) -> IResult, Self> { + fn parse_sym(i: LocatedSpan<&str>) -> IResult, String> { + let (i, v) = many0(none_of(",=\n+"))(i)?; + Ok((i, v.into_iter().collect::())) + } + + let mut parser = tuple(( + tag("```argus"), + many0(preceded( + char(','), + alt(( + separated_pair(parse_sym, char('='), parse_sym), + map(parse_sym, |s| (s, String::from("true"))), + )), + )), + take_until("```"), + tag("```"), + )); + let (i, (_, config, code, _)) = parser(i)?; + let code = code.fragment().trim().to_string(); + + Ok((i, ArgusBlock { config, code })) + } + + pub fn parse_all(content: &str) -> Vec<(Range, Self)> { + let mut content = LocatedSpan::new(content); + let mut to_process = Vec::new(); + loop { + if let Ok((next, block)) = ArgusBlock::parse(content) { + let range = content.location_offset() .. next.location_offset(); + to_process.push((range, block)); + content = next; + } else { + match anychar::<_, nom::error::Error>>(content) { + Ok((next, _)) => { + content = next; + } + Err(_) => break, + } + } + } + + to_process + } +} + +#[test] +fn test_parse_block() { + let inp = r#"```argus,foo=bar,baz +content! +```"#; + let s = |s: &str| s.to_string(); + let blocks = ArgusBlock::parse_all(inp); + assert_eq!(blocks, vec![(0 .. inp.len(), ArgusBlock { + config: vec![(s("foo"), s("bar")), (s("baz"), s("true"))], + code: s("content!"), + })]); +} diff --git a/crates/mdbook-argus/src/main.rs b/crates/mdbook-argus/src/main.rs new file mode 100644 index 0000000..ff23c96 --- /dev/null +++ b/crates/mdbook-argus/src/main.rs @@ -0,0 +1,169 @@ +use std::{ + fs, + ops::Range, + path::{Path, PathBuf}, + process::{Command, Stdio}, +}; + +use anyhow::{anyhow, ensure, Context, Result}; +use block::ArgusBlock; +use mdbook_preprocessor_utils::{ + mdbook::preprocess::PreprocessorContext, Asset, HtmlElementBuilder, + SimplePreprocessor, +}; +use rayon::prelude::*; +use serde::{Deserialize, Serialize}; +use serde_json::json; +use tempfile::tempdir; + +mod block; + +mdbook_preprocessor_utils::asset_generator!("../js/"); + +const FRONTEND_ASSETS: [Asset; 2] = + [make_asset!("panoptes.iife.js"), make_asset!("style.css")]; + +const TOOLCHAIN_TOML: &str = include_str!("../rust-toolchain.toml"); + +pub fn get_toolchain() -> Result { + let config: toml::Value = toml::from_str(TOOLCHAIN_TOML)?; + Ok( + config + .get("toolchain") + .context("Missing toolchain key")? + .get("channel") + .context("Missing channel key")? + .as_str() + .unwrap() + .to_string(), + ) +} + +struct ArgusPreprocessor { + toolchain: String, + target_libdir: PathBuf, +} + +impl ArgusPreprocessor { + fn new() -> Result { + let run_and_get_output = |cmd: &mut Command| -> Result { + let output = cmd.output()?; + ensure!(output.status.success(), "Command failed"); + let stdout = String::from_utf8(output.stdout)?; + Ok(stdout.trim_end().to_string()) + }; + + let toolchain = get_toolchain()?; + let output = run_and_get_output(Command::new("rustup").args([ + "which", + "--toolchain", + &toolchain, + "rustc", + ]))?; + let rustc = PathBuf::from(output); + + let output = run_and_get_output( + Command::new(rustc).args(["--print", "target-libdir"]), + )?; + let target_libdir = PathBuf::from(output); + + Ok(ArgusPreprocessor { + toolchain, + target_libdir, + }) + } + + fn run_argus(&self, block: &ArgusBlock) -> Result { + let tempdir = tempdir()?; + let root = tempdir.path(); + let status = Command::new("cargo") + .args(["new", "--bin", "example"]) + .current_dir(root) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status()?; + ensure!(status.success(), "Cargo failed"); + + let crate_root = root.join("example"); + fs::write(crate_root.join("src/main.rs"), &block.code)?; + + let mut cmd = Command::new("cargo"); + cmd + .args([&format!("+{}", self.toolchain), "argus", "bundle"]) + .env("DYLD_LIBRARY_PATH", &self.target_libdir) + .env("LD_LIBRARY_PATH", &self.target_libdir) + .current_dir(crate_root); + + let child = cmd.stdout(Stdio::piped()).stderr(Stdio::piped()).spawn()?; + let output = child.wait_with_output()?; + ensure!( + output.status.success(), + "Argus failed for program:\n{}\nwith error:\n{}", + block.code, + String::from_utf8(output.stderr)? + ); + + let response = String::from_utf8(output.stdout)?; + let response_json_res: Result, String> = + serde_json::from_str(&response)?; + let response_json = response_json_res.map_err(|e| anyhow!("{e}"))?; + + let bodies = response_json + .iter() + .map(|obj| obj.as_object().unwrap().get("body").unwrap().clone()) + .collect::>(); + let config = json!({ + "type": "WEB_BUNDLE", + "closedSystem": response_json, + "data": [("main.rs", bodies)] + }); + + Ok(serde_json::to_string(&config)?) + } + + fn process_code(&self, block: ArgusBlock) -> Result { + let config = self.run_argus(&block)?; + + let mut element = HtmlElementBuilder::new("argus-embed"); + element.data("config", config)?; + element.finish() + } +} + +impl SimplePreprocessor for ArgusPreprocessor { + fn name() -> &'static str { + "argus" + } + + fn build(ctx: &PreprocessorContext) -> Result { + ArgusPreprocessor::new() + } + + fn replacements( + &self, + chapter_dir: &Path, + content: &str, + ) -> Result, String)>> { + ArgusBlock::parse_all(content) + .into_par_iter() + .map(|(range, block)| { + let html = self.process_code(block)?; + Ok((range, html)) + }) + .collect() + } + + fn linked_assets(&self) -> Vec { + FRONTEND_ASSETS.to_vec() + } + + fn all_assets(&self) -> Vec { + self.linked_assets() + } + + fn finish(self) {} +} + +fn main() { + mdbook_preprocessor_utils::main::() +} diff --git a/crates/mdbook-argus/test-book/.gitignore b/crates/mdbook-argus/test-book/.gitignore new file mode 100644 index 0000000..22671c2 --- /dev/null +++ b/crates/mdbook-argus/test-book/.gitignore @@ -0,0 +1,2 @@ +book/ +src/argus \ No newline at end of file diff --git a/crates/mdbook-argus/test-book/book.toml b/crates/mdbook-argus/test-book/book.toml new file mode 100644 index 0000000..dbf322d --- /dev/null +++ b/crates/mdbook-argus/test-book/book.toml @@ -0,0 +1,10 @@ +[book] +authors = ["Will Crichton"] +language = "en" +multilingual = false +src = "src" + +[output.html] +additional-css = ["vars.css"] + +[preprocessor.argus] \ No newline at end of file diff --git a/crates/mdbook-argus/test-book/src/SUMMARY.md b/crates/mdbook-argus/test-book/src/SUMMARY.md new file mode 100644 index 0000000..7390c82 --- /dev/null +++ b/crates/mdbook-argus/test-book/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [Chapter 1](./chapter_1.md) diff --git a/crates/mdbook-argus/test-book/src/chapter_1.md b/crates/mdbook-argus/test-book/src/chapter_1.md new file mode 100644 index 0000000..42a97e4 --- /dev/null +++ b/crates/mdbook-argus/test-book/src/chapter_1.md @@ -0,0 +1,30 @@ +# Chapter 1 + +```argus +trait IntoString { + fn to_string(&self) -> String; +} + +impl IntoString for (i32, i32) { + fn to_string(&self) -> String { + String::from("(...)") + } +} + +impl IntoString for Vec { + fn to_string(&self) -> String { + String::from("Vec") + } +} + +impl IntoString for [T] { + fn to_string(&self) -> String { + String::from("[T]") + } +} + +fn main() { + fn is_into_string() {} + is_into_string::>(); +} +``` \ No newline at end of file diff --git a/crates/mdbook-argus/test-book/vars.css b/crates/mdbook-argus/test-book/vars.css new file mode 100644 index 0000000..f8aefa1 --- /dev/null +++ b/crates/mdbook-argus/test-book/vars.css @@ -0,0 +1,650 @@ +--vscode-foreground: #616161; +--vscode-disabledForeground: rgba(97, 97, 97, 0.5); +--vscode-errorForeground: #a1260d; +--vscode-descriptionForeground: #717171; +--vscode-icon-foreground: #424242; +--vscode-focusBorder: #0090f1; +--vscode-textSeparator-foreground: rgba(0, 0, 0, 0.18); +--vscode-textLink-foreground: #006ab1; +--vscode-textLink-activeForeground: #006ab1; +--vscode-textPreformat-foreground: #a31515; +--vscode-textPreformat-background: rgba(0, 0, 0, 0.1); +--vscode-textBlockQuote-background: #f2f2f2; +--vscode-textBlockQuote-border: rgba(0, 122, 204, 0.5); +--vscode-textCodeBlock-background: rgba(220, 220, 220, 0.4); +--vscode-widget-shadow: rgba(0, 0, 0, 0.16); +--vscode-widget-border: #d4d4d4; +--vscode-input-background: #ffffff; +--vscode-input-foreground: #616161; +--vscode-inputOption-activeBorder: #007acc; +--vscode-inputOption-hoverBackground: rgba(184, 184, 184, 0.31); +--vscode-inputOption-activeBackground: rgba(0, 144, 241, 0.2); +--vscode-inputOption-activeForeground: #000000; +--vscode-input-placeholderForeground: #767676; +--vscode-inputValidation-infoBackground: #d6ecf2; +--vscode-inputValidation-infoBorder: #007acc; +--vscode-inputValidation-warningBackground: #f6f5d2; +--vscode-inputValidation-warningBorder: #b89500; +--vscode-inputValidation-errorBackground: #f2dede; +--vscode-inputValidation-errorBorder: #be1100; +--vscode-dropdown-background: #ffffff; +--vscode-dropdown-foreground: #616161; +--vscode-dropdown-border: #cecece; +--vscode-button-foreground: #ffffff; +--vscode-button-separator: rgba(255, 255, 255, 0.4); +--vscode-button-background: #007acc; +--vscode-button-hoverBackground: #0062a3; +--vscode-button-secondaryForeground: #ffffff; +--vscode-button-secondaryBackground: #5f6a79; +--vscode-button-secondaryHoverBackground: #4c5561; +--vscode-badge-background: #c4c4c4; +--vscode-badge-foreground: #333333; +--vscode-scrollbar-shadow: #dddddd; +--vscode-scrollbarSlider-background: rgba(100, 100, 100, 0.4); +--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); +--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, 0.6); +--vscode-progressBar-background: #0e70c0; +--vscode-editorError-foreground: #e51400; +--vscode-editorWarning-foreground: #bf8803; +--vscode-editorInfo-foreground: #1a85ff; +--vscode-editorHint-foreground: #6c6c6c; +--vscode-sash-hoverBorder: #0090f1; +--vscode-editor-background: #ffffff; +--vscode-editor-foreground: #000000; +--vscode-editorStickyScroll-background: #ffffff; +--vscode-editorStickyScrollHover-background: #f0f0f0; +--vscode-editorStickyScroll-shadow: #dddddd; +--vscode-editorWidget-background: #f3f3f3; +--vscode-editorWidget-foreground: #616161; +--vscode-editorWidget-border: #c8c8c8; +--vscode-quickInput-background: #f3f3f3; +--vscode-quickInput-foreground: #616161; +--vscode-quickInputTitle-background: rgba(0, 0, 0, 0.06); +--vscode-pickerGroup-foreground: #0066bf; +--vscode-pickerGroup-border: #cccedb; +--vscode-keybindingLabel-background: rgba(221, 221, 221, 0.4); +--vscode-keybindingLabel-foreground: #555555; +--vscode-keybindingLabel-border: rgba(204, 204, 204, 0.4); +--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, 0.4); +--vscode-editor-selectionBackground: #add6ff; +--vscode-editor-inactiveSelectionBackground: #e5ebf1; +--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, 0.5); +--vscode-editor-findMatchBackground: #a8ac94; +--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); +--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, 0.3); +--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, 0.22); +--vscode-search-resultsInfoForeground: #616161; +--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, 0.15); +--vscode-editorHoverWidget-background: #f3f3f3; +--vscode-editorHoverWidget-foreground: #616161; +--vscode-editorHoverWidget-border: #c8c8c8; +--vscode-editorHoverWidget-statusBarBackground: #e7e7e7; +--vscode-editorLink-activeForeground: #0000ff; +--vscode-editorInlayHint-foreground: #969696; +--vscode-editorInlayHint-background: rgba(196, 196, 196, 0.1); +--vscode-editorInlayHint-typeForeground: #969696; +--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, 0.1); +--vscode-editorInlayHint-parameterForeground: #969696; +--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, 0.1); +--vscode-editorLightBulb-foreground: #ddb100; +--vscode-editorLightBulbAutoFix-foreground: #007acc; +--vscode-editorLightBulbAi-foreground: #ddb100; +--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, 0.25); +--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, 0.2); +--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, 0.2); +--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, 0.2); +--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, 0.2); +--vscode-diffEditor-unchangedRegionBackground: #f8f8f8; +--vscode-diffEditor-unchangedRegionForeground: #616161; +--vscode-diffEditor-unchangedCodeBackground: rgba(184, 184, 184, 0.16); +--vscode-list-focusOutline: #0090f1; +--vscode-list-focusAndSelectionOutline: #90c2f9; +--vscode-list-activeSelectionBackground: #0060c0; +--vscode-list-activeSelectionForeground: #ffffff; +--vscode-list-activeSelectionIconForeground: #ffffff; +--vscode-list-inactiveSelectionBackground: #e4e6f1; +--vscode-list-hoverBackground: #e8e8e8; +--vscode-list-dropBackground: #d6ebff; +--vscode-list-dropBetweenBackground: #424242; +--vscode-list-highlightForeground: #0066bf; +--vscode-list-focusHighlightForeground: #bbe7ff; +--vscode-list-invalidItemForeground: #b89500; +--vscode-list-errorForeground: #b01011; +--vscode-list-warningForeground: #855f00; +--vscode-listFilterWidget-background: #f3f3f3; +--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0); +--vscode-listFilterWidget-noMatchesOutline: #be1100; +--vscode-listFilterWidget-shadow: rgba(0, 0, 0, 0.16); +--vscode-list-filterMatchBackground: rgba(234, 92, 0, 0.33); +--vscode-tree-indentGuidesStroke: #a9a9a9; +--vscode-tree-inactiveIndentGuidesStroke: rgba(169, 169, 169, 0.4); +--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, 0.13); +--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, 0.04); +--vscode-list-deemphasizedForeground: #8e8e90; +--vscode-checkbox-background: #ffffff; +--vscode-checkbox-selectBackground: #f3f3f3; +--vscode-checkbox-foreground: #616161; +--vscode-checkbox-border: #919191; +--vscode-checkbox-selectBorder: #424242; +--vscode-quickInputList-focusForeground: #ffffff; +--vscode-quickInputList-focusIconForeground: #ffffff; +--vscode-quickInputList-focusBackground: #0060c0; +--vscode-menu-border: #d4d4d4; +--vscode-menu-foreground: #616161; +--vscode-menu-background: #ffffff; +--vscode-menu-selectionForeground: #ffffff; +--vscode-menu-selectionBackground: #0060c0; +--vscode-menu-separatorBackground: #d4d4d4; +--vscode-toolbar-hoverBackground: rgba(184, 184, 184, 0.31); +--vscode-toolbar-activeBackground: rgba(166, 166, 166, 0.31); +--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, 0.2); +--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, 0.5); +--vscode-breadcrumb-foreground: rgba(97, 97, 97, 0.8); +--vscode-breadcrumb-background: #ffffff; +--vscode-breadcrumb-focusForeground: #4e4e4e; +--vscode-breadcrumb-activeSelectionForeground: #4e4e4e; +--vscode-breadcrumbPicker-background: #f3f3f3; +--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, 0.5); +--vscode-merge-currentContentBackground: rgba(64, 200, 174, 0.2); +--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, 0.5); +--vscode-merge-incomingContentBackground: rgba(64, 166, 255, 0.2); +--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, 0.4); +--vscode-merge-commonContentBackground: rgba(96, 96, 96, 0.16); +--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, 0.5); +--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, 0.5); +--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, 0.4); +--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49); +--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, 0.8); +--vscode-minimap-findMatchHighlight: #d18616; +--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9; +--vscode-minimap-selectionHighlight: #add6ff; +--vscode-minimap-infoHighlight: #1a85ff; +--vscode-minimap-warningHighlight: #bf8803; +--vscode-minimap-errorHighlight: rgba(255, 18, 18, 0.7); +--vscode-minimap-foregroundOpacity: #000000; +--vscode-minimapSlider-background: rgba(100, 100, 100, 0.2); +--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, 0.35); +--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, 0.3); +--vscode-problemsErrorIcon-foreground: #e51400; +--vscode-problemsWarningIcon-foreground: #bf8803; +--vscode-problemsInfoIcon-foreground: #1a85ff; +--vscode-charts-foreground: #616161; +--vscode-charts-lines: rgba(97, 97, 97, 0.5); +--vscode-charts-red: #e51400; +--vscode-charts-blue: #1a85ff; +--vscode-charts-yellow: #bf8803; +--vscode-charts-orange: #d18616; +--vscode-charts-green: #388a34; +--vscode-charts-purple: #652d90; +--vscode-multiDiffEditor-headerBackground: #ececec; +--vscode-multiDiffEditor-border: #cccccc; +--vscode-symbolIcon-arrayForeground: #616161; +--vscode-symbolIcon-booleanForeground: #616161; +--vscode-symbolIcon-classForeground: #d67e00; +--vscode-symbolIcon-colorForeground: #616161; +--vscode-symbolIcon-constantForeground: #616161; +--vscode-symbolIcon-constructorForeground: #652d90; +--vscode-symbolIcon-enumeratorForeground: #d67e00; +--vscode-symbolIcon-enumeratorMemberForeground: #007acc; +--vscode-symbolIcon-eventForeground: #d67e00; +--vscode-symbolIcon-fieldForeground: #007acc; +--vscode-symbolIcon-fileForeground: #616161; +--vscode-symbolIcon-folderForeground: #616161; +--vscode-symbolIcon-functionForeground: #652d90; +--vscode-symbolIcon-interfaceForeground: #007acc; +--vscode-symbolIcon-keyForeground: #616161; +--vscode-symbolIcon-keywordForeground: #616161; +--vscode-symbolIcon-methodForeground: #652d90; +--vscode-symbolIcon-moduleForeground: #616161; +--vscode-symbolIcon-namespaceForeground: #616161; +--vscode-symbolIcon-nullForeground: #616161; +--vscode-symbolIcon-numberForeground: #616161; +--vscode-symbolIcon-objectForeground: #616161; +--vscode-symbolIcon-operatorForeground: #616161; +--vscode-symbolIcon-packageForeground: #616161; +--vscode-symbolIcon-propertyForeground: #616161; +--vscode-symbolIcon-referenceForeground: #616161; +--vscode-symbolIcon-snippetForeground: #616161; +--vscode-symbolIcon-stringForeground: #616161; +--vscode-symbolIcon-structForeground: #616161; +--vscode-symbolIcon-textForeground: #616161; +--vscode-symbolIcon-typeParameterForeground: #616161; +--vscode-symbolIcon-unitForeground: #616161; +--vscode-symbolIcon-variableForeground: #007acc; +--vscode-actionBar-toggledBackground: #dddddd; +--vscode-editorHoverWidget-highlightForeground: #0066bf; +--vscode-editor-lineHighlightBorder: #eeeeee; +--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, 0.2); +--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, 0.33); +--vscode-editorCursor-foreground: #000000; +--vscode-editorWhitespace-foreground: rgba(51, 51, 51, 0.2); +--vscode-editorLineNumber-foreground: #237893; +--vscode-editorIndentGuide-background: rgba(51, 51, 51, 0.2); +--vscode-editorIndentGuide-activeBackground: rgba(51, 51, 51, 0.2); +--vscode-editorIndentGuide-background1: #d3d3d3; +--vscode-editorIndentGuide-background2: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-background3: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-background4: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-background5: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-background6: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-activeBackground1: #939393; +--vscode-editorIndentGuide-activeBackground2: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-activeBackground3: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-activeBackground4: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-activeBackground5: rgba(0, 0, 0, 0); +--vscode-editorIndentGuide-activeBackground6: rgba(0, 0, 0, 0); +--vscode-editorActiveLineNumber-foreground: #0b216f; +--vscode-editorLineNumber-activeForeground: #0b216f; +--vscode-editorRuler-foreground: #d3d3d3; +--vscode-editorCodeLens-foreground: #919191; +--vscode-editorBracketMatch-background: rgba(0, 100, 0, 0.1); +--vscode-editorBracketMatch-border: #b9b9b9; +--vscode-editorOverviewRuler-border: rgba(127, 127, 127, 0.3); +--vscode-editorGutter-background: #ffffff; +--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, 0.47); +--vscode-editorGhostText-foreground: rgba(0, 0, 0, 0.47); +--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6); +--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, 0.7); +--vscode-editorOverviewRuler-warningForeground: #bf8803; +--vscode-editorOverviewRuler-infoForeground: #1a85ff; +--vscode-editorBracketHighlight-foreground1: #0431fa; +--vscode-editorBracketHighlight-foreground2: #319331; +--vscode-editorBracketHighlight-foreground3: #7b3814; +--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0); +--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0); +--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0); +--vscode-editorBracketHighlight-unexpectedBracket-foreground: rgba(255, 18, 18, 0.8); +--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0); +--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0); +--vscode-editorUnicodeHighlight-border: #bf8803; +--vscode-diffEditor-move-border: rgba(139, 139, 139, 0.61); +--vscode-diffEditor-moveActive-border: #ffa500; +--vscode-diffEditor-unchangedRegionShadow: rgba(115, 115, 115, 0.75); +--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0; +--vscode-editor-foldBackground: rgba(173, 214, 255, 0.3); +--vscode-editorGutter-foldingControlForeground: #424242; +--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, 0.3); +--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, 0.25); +--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, 0.25); +--vscode-editor-wordHighlightTextBackground: rgba(87, 87, 87, 0.25); +--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, 0.8); +--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, 0.8); +--vscode-editorOverviewRuler-wordHighlightTextForeground: rgba(160, 160, 160, 0.8); +--vscode-peekViewTitle-background: #f3f3f3; +--vscode-peekViewTitleLabel-foreground: #000000; +--vscode-peekViewTitleDescription-foreground: #616161; +--vscode-peekView-border: #1a85ff; +--vscode-peekViewResult-background: #f3f3f3; +--vscode-peekViewResult-lineForeground: #646465; +--vscode-peekViewResult-fileForeground: #1e1e1e; +--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, 0.2); +--vscode-peekViewResult-selectionForeground: #6c6c6c; +--vscode-peekViewEditor-background: #f2f8fc; +--vscode-peekViewEditorGutter-background: #f2f8fc; +--vscode-peekViewEditorStickyScroll-background: #f2f8fc; +--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, 0.3); +--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, 0.87); +--vscode-editorMarkerNavigationError-background: #e51400; +--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, 0.1); +--vscode-editorMarkerNavigationWarning-background: #bf8803; +--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, 0.1); +--vscode-editorMarkerNavigationInfo-background: #1a85ff; +--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, 0.1); +--vscode-editorMarkerNavigation-background: #ffffff; +--vscode-editorSuggestWidget-background: #f3f3f3; +--vscode-editorSuggestWidget-border: #c8c8c8; +--vscode-editorSuggestWidget-foreground: #000000; +--vscode-editorSuggestWidget-selectedForeground: #ffffff; +--vscode-editorSuggestWidget-selectedIconForeground: #ffffff; +--vscode-editorSuggestWidget-selectedBackground: #0060c0; +--vscode-editorSuggestWidget-highlightForeground: #0066bf; +--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff; +--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, 0.5); +--vscode-editorWatermark-foreground: rgba(0, 0, 0, 0.68); +--vscode-tab-activeBackground: #ffffff; +--vscode-tab-unfocusedActiveBackground: #ffffff; +--vscode-tab-inactiveBackground: #ececec; +--vscode-tab-unfocusedInactiveBackground: #ececec; +--vscode-tab-activeForeground: #333333; +--vscode-tab-inactiveForeground: rgba(51, 51, 51, 0.7); +--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, 0.7); +--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, 0.35); +--vscode-tab-border: #f3f3f3; +--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, 0.19); +--vscode-tab-dragAndDropBorder: #333333; +--vscode-tab-activeModifiedBorder: #33aaee; +--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, 0.5); +--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, 0.7); +--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, 0.25); +--vscode-editorPane-background: #ffffff; +--vscode-editorGroupHeader-tabsBackground: #f3f3f3; +--vscode-editorGroupHeader-noTabsBackground: #ffffff; +--vscode-editorGroup-border: #e7e7e7; +--vscode-editorGroup-dropBackground: rgba(38, 119, 203, 0.18); +--vscode-editorGroup-dropIntoPromptForeground: #616161; +--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3; +--vscode-sideBySideEditor-horizontalBorder: #e7e7e7; +--vscode-sideBySideEditor-verticalBorder: #e7e7e7; +--vscode-panel-background: #ffffff; +--vscode-panel-border: rgba(128, 128, 128, 0.35); +--vscode-panelTitle-activeForeground: #424242; +--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, 0.75); +--vscode-panelTitle-activeBorder: #424242; +--vscode-panelInput-border: #dddddd; +--vscode-panel-dropBorder: #424242; +--vscode-panelSection-dropBackground: rgba(38, 119, 203, 0.18); +--vscode-panelSectionHeader-background: rgba(128, 128, 128, 0.2); +--vscode-panelSection-border: rgba(128, 128, 128, 0.35); +--vscode-banner-background: #004386; +--vscode-banner-foreground: #ffffff; +--vscode-banner-iconForeground: #1a85ff; +--vscode-statusBar-foreground: #ffffff; +--vscode-statusBar-noFolderForeground: #ffffff; +--vscode-statusBar-background: #007acc; +--vscode-statusBar-noFolderBackground: #68217a; +--vscode-statusBar-focusBorder: #ffffff; +--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, 0.18); +--vscode-statusBarItem-focusBorder: #ffffff; +--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, 0.12); +--vscode-statusBarItem-hoverForeground: #ffffff; +--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2); +--vscode-statusBarItem-prominentForeground: #ffffff; +--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, 0.5); +--vscode-statusBarItem-prominentHoverForeground: #ffffff; +--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3); +--vscode-statusBarItem-errorBackground: #c72e0f; +--vscode-statusBarItem-errorForeground: #ffffff; +--vscode-statusBarItem-errorHoverForeground: #ffffff; +--vscode-statusBarItem-errorHoverBackground: rgba(255, 255, 255, 0.12); +--vscode-statusBarItem-warningBackground: #725102; +--vscode-statusBarItem-warningForeground: #ffffff; +--vscode-statusBarItem-warningHoverForeground: #ffffff; +--vscode-statusBarItem-warningHoverBackground: rgba(255, 255, 255, 0.12); +--vscode-activityBar-background: #2c2c2c; +--vscode-activityBar-foreground: #ffffff; +--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, 0.4); +--vscode-activityBar-activeBorder: #ffffff; +--vscode-activityBar-dropBorder: #ffffff; +--vscode-activityBarBadge-background: #007acc; +--vscode-activityBarBadge-foreground: #ffffff; +--vscode-activityBarTop-foreground: #424242; +--vscode-activityBarTop-activeBorder: #424242; +--vscode-activityBarTop-inactiveForeground: rgba(66, 66, 66, 0.75); +--vscode-activityBarTop-dropBorder: #424242; +--vscode-profileBadge-background: #c4c4c4; +--vscode-profileBadge-foreground: #333333; +--vscode-statusBarItem-remoteBackground: #16825d; +--vscode-statusBarItem-remoteForeground: #ffffff; +--vscode-statusBarItem-remoteHoverForeground: #ffffff; +--vscode-statusBarItem-remoteHoverBackground: rgba(255, 255, 255, 0.12); +--vscode-statusBarItem-offlineBackground: #6c1717; +--vscode-statusBarItem-offlineForeground: #ffffff; +--vscode-statusBarItem-offlineHoverForeground: #ffffff; +--vscode-statusBarItem-offlineHoverBackground: rgba(255, 255, 255, 0.12); +--vscode-extensionBadge-remoteBackground: #007acc; +--vscode-extensionBadge-remoteForeground: #ffffff; +--vscode-sideBar-background: #f3f3f3; +--vscode-sideBarTitle-foreground: #6f6f6f; +--vscode-sideBar-dropBackground: rgba(38, 119, 203, 0.18); +--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0); +--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, 0.19); +--vscode-titleBar-activeForeground: #333333; +--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, 0.6); +--vscode-titleBar-activeBackground: #dddddd; +--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, 0.6); +--vscode-menubar-selectionForeground: #333333; +--vscode-menubar-selectionBackground: rgba(184, 184, 184, 0.31); +--vscode-commandCenter-foreground: #333333; +--vscode-commandCenter-activeForeground: #333333; +--vscode-commandCenter-inactiveForeground: rgba(51, 51, 51, 0.6); +--vscode-commandCenter-background: rgba(0, 0, 0, 0.05); +--vscode-commandCenter-activeBackground: rgba(0, 0, 0, 0.08); +--vscode-commandCenter-border: rgba(51, 51, 51, 0.2); +--vscode-commandCenter-activeBorder: rgba(51, 51, 51, 0.3); +--vscode-commandCenter-inactiveBorder: rgba(51, 51, 51, 0.15); +--vscode-notificationCenter-border: #d4d4d4; +--vscode-notificationToast-border: #d4d4d4; +--vscode-notifications-foreground: #616161; +--vscode-notifications-background: #f3f3f3; +--vscode-notificationLink-foreground: #006ab1; +--vscode-notificationCenterHeader-background: #e7e7e7; +--vscode-notifications-border: #e7e7e7; +--vscode-notificationsErrorIcon-foreground: #e51400; +--vscode-notificationsWarningIcon-foreground: #bf8803; +--vscode-notificationsInfoIcon-foreground: #1a85ff; +--vscode-chat-requestBorder: rgba(0, 0, 0, 0.1); +--vscode-chat-requestBackground: rgba(255, 255, 255, 0.62); +--vscode-chat-slashCommandBackground: #d2ecff; +--vscode-chat-slashCommandForeground: #306ca2; +--vscode-chat-avatarBackground: #f2f2f2; +--vscode-chat-avatarForeground: #616161; +--vscode-simpleFindWidget-sashBorder: #c8c8c8; +--vscode-commentsView-resolvedIcon: rgba(97, 97, 97, 0.5); +--vscode-commentsView-unresolvedIcon: #0090f1; +--vscode-editorCommentsWidget-replyInputBackground: #f3f3f3; +--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, 0.5); +--vscode-editorCommentsWidget-unresolvedBorder: #0090f1; +--vscode-editorCommentsWidget-rangeBackground: rgba(0, 144, 241, 0.1); +--vscode-editorCommentsWidget-rangeActiveBackground: rgba(0, 144, 241, 0.1); +--vscode-editorGutter-commentRangeForeground: #d5d8e9; +--vscode-editorOverviewRuler-commentForeground: #d5d8e9; +--vscode-editorOverviewRuler-commentUnresolvedForeground: #d5d8e9; +--vscode-editorGutter-commentGlyphForeground: #000000; +--vscode-editorGutter-commentUnresolvedGlyphForeground: #000000; +--vscode-debugToolBar-background: #f3f3f3; +--vscode-debugIcon-startForeground: #388a34; +--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, 0.45); +--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, 0.45); +--vscode-mergeEditor-change-background: rgba(155, 185, 85, 0.2); +--vscode-mergeEditor-change-word-background: rgba(156, 204, 44, 0.4); +--vscode-mergeEditor-changeBase-background: #ffcccc; +--vscode-mergeEditor-changeBase-word-background: #ffa3a3; +--vscode-mergeEditor-conflict-unhandledUnfocused-border: #ffa600; +--vscode-mergeEditor-conflict-unhandledFocused-border: #ffa600; +--vscode-mergeEditor-conflict-handledUnfocused-border: rgba(134, 134, 134, 0.29); +--vscode-mergeEditor-conflict-handledFocused-border: rgba(193, 193, 193, 0.8); +--vscode-mergeEditor-conflict-handled-minimapOverViewRuler: rgba(173, 172, 168, 0.93); +--vscode-mergeEditor-conflict-unhandled-minimapOverViewRuler: #fcba03; +--vscode-mergeEditor-conflictingLines-background: rgba(255, 234, 0, 0.28); +--vscode-mergeEditor-conflict-input1-background: rgba(64, 200, 174, 0.2); +--vscode-mergeEditor-conflict-input2-background: rgba(64, 166, 255, 0.2); +--vscode-settings-headerForeground: #444444; +--vscode-settings-settingsHeaderHoverForeground: rgba(68, 68, 68, 0.7); +--vscode-settings-modifiedItemIndicator: #66afe0; +--vscode-settings-headerBorder: rgba(128, 128, 128, 0.35); +--vscode-settings-sashBorder: rgba(128, 128, 128, 0.35); +--vscode-settings-dropdownBackground: #ffffff; +--vscode-settings-dropdownForeground: #616161; +--vscode-settings-dropdownBorder: #cecece; +--vscode-settings-dropdownListBorder: #c8c8c8; +--vscode-settings-checkboxBackground: #ffffff; +--vscode-settings-checkboxForeground: #616161; +--vscode-settings-checkboxBorder: #919191; +--vscode-settings-textInputBackground: #ffffff; +--vscode-settings-textInputForeground: #616161; +--vscode-settings-textInputBorder: #cecece; +--vscode-settings-numberInputBackground: #ffffff; +--vscode-settings-numberInputForeground: #616161; +--vscode-settings-numberInputBorder: #cecece; +--vscode-settings-focusedRowBackground: rgba(232, 232, 232, 0.6); +--vscode-settings-rowHoverBackground: rgba(232, 232, 232, 0.3); +--vscode-settings-focusedRowBorder: #0090f1; +--vscode-terminal-foreground: #333333; +--vscode-terminal-selectionBackground: #add6ff; +--vscode-terminal-inactiveSelectionBackground: #e5ebf1; +--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, 0.25); +--vscode-terminalCommandDecoration-successBackground: #2090d3; +--vscode-terminalCommandDecoration-errorBackground: #e51400; +--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8); +--vscode-terminal-border: rgba(128, 128, 128, 0.35); +--vscode-terminal-findMatchBackground: #a8ac94; +--vscode-terminal-hoverHighlightBackground: rgba(173, 214, 255, 0.07); +--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, 0.33); +--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49); +--vscode-terminal-dropBackground: rgba(38, 119, 203, 0.18); +--vscode-terminalStickyScrollHover-background: #f0f0f0; +--vscode-testing-iconFailed: #f14c4c; +--vscode-testing-iconErrored: #f14c4c; +--vscode-testing-iconPassed: #73c991; +--vscode-testing-runAction: #73c991; +--vscode-testing-iconQueued: #cca700; +--vscode-testing-iconUnset: #848484; +--vscode-testing-iconSkipped: #848484; +--vscode-testing-peekBorder: #e51400; +--vscode-testing-messagePeekBorder: #1a85ff; +--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, 0.1); +--vscode-testing-messagePeekHeaderBackground: rgba(26, 133, 255, 0.1); +--vscode-testing-coveredBackground: rgba(156, 204, 44, 0.25); +--vscode-testing-coveredBorder: rgba(156, 204, 44, 0.19); +--vscode-testing-coveredGutterBackground: rgba(156, 204, 44, 0.15); +--vscode-testing-uncoveredBranchBackground: #ff9999; +--vscode-testing-uncoveredBackground: rgba(255, 0, 0, 0.2); +--vscode-testing-uncoveredBorder: rgba(255, 0, 0, 0.15); +--vscode-testing-uncoveredGutterBackground: rgba(255, 0, 0, 0.3); +--vscode-testing-coverCountBadgeBackground: #c4c4c4; +--vscode-testing-coverCountBadgeForeground: #333333; +--vscode-testing-message-error-decorationForeground: #e51400; +--vscode-testing-message-error-lineBackground: rgba(255, 0, 0, 0.2); +--vscode-testing-message-info-decorationForeground: rgba(0, 0, 0, 0.5); +--vscode-welcomePage-tileBackground: #f3f3f3; +--vscode-welcomePage-tileHoverBackground: #dbdbdb; +--vscode-welcomePage-tileBorder: rgba(0, 0, 0, 0.1); +--vscode-welcomePage-progress-background: #ffffff; +--vscode-welcomePage-progress-foreground: #006ab1; +--vscode-walkthrough-stepTitle-foreground: #000000; +--vscode-walkThrough-embeddedEditorBackground: #f4f4f4; +--vscode-inlineChat-background: #f3f3f3; +--vscode-inlineChat-border: #c8c8c8; +--vscode-inlineChat-shadow: rgba(0, 0, 0, 0.16); +--vscode-inlineChat-regionHighlight: rgba(173, 214, 255, 0.15); +--vscode-inlineChatInput-border: #c8c8c8; +--vscode-inlineChatInput-focusBorder: #0090f1; +--vscode-inlineChatInput-placeholderForeground: #767676; +--vscode-inlineChatInput-background: #ffffff; +--vscode-inlineChatDiff-inserted: rgba(156, 204, 44, 0.13); +--vscode-editorOverviewRuler-inlineChatInserted: rgba(156, 204, 44, 0.2); +--vscode-inlineChatDiff-removed: rgba(255, 0, 0, 0.1); +--vscode-editorOverviewRuler-inlineChatRemoved: rgba(255, 0, 0, 0.16); +--vscode-debugExceptionWidget-border: #a31515; +--vscode-debugExceptionWidget-background: #f1dfde; +--vscode-statusBar-debuggingBackground: #cc6633; +--vscode-statusBar-debuggingForeground: #ffffff; +--vscode-commandCenter-debuggingBackground: rgba(204, 102, 51, 0.26); +--vscode-editorGutter-modifiedBackground: #2090d3; +--vscode-editorGutter-addedBackground: #48985d; +--vscode-editorGutter-deletedBackground: #e51400; +--vscode-minimapGutter-modifiedBackground: #2090d3; +--vscode-minimapGutter-addedBackground: #48985d; +--vscode-minimapGutter-deletedBackground: #e51400; +--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, 0.6); +--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, 0.6); +--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, 0.6); +--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, 0.04); +--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, 0.04); +--vscode-debugIcon-breakpointForeground: #e51400; +--vscode-debugIcon-breakpointDisabledForeground: #848484; +--vscode-debugIcon-breakpointUnverifiedForeground: #848484; +--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700; +--vscode-debugIcon-breakpointStackframeForeground: #89d185; +--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, 0.5); +--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2); +--vscode-ports-iconRunningProcessForeground: #369432; +--vscode-debugTokenExpression-name: #9b46b0; +--vscode-debugTokenExpression-value: rgba(108, 108, 108, 0.8); +--vscode-debugTokenExpression-string: #a31515; +--vscode-debugTokenExpression-boolean: #0000ff; +--vscode-debugTokenExpression-number: #098658; +--vscode-debugTokenExpression-error: #e51400; +--vscode-debugView-exceptionLabelForeground: #ffffff; +--vscode-debugView-exceptionLabelBackground: #a31515; +--vscode-debugView-stateLabelForeground: #616161; +--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27); +--vscode-debugView-valueChangedHighlight: #569cd6; +--vscode-debugConsole-infoForeground: #1a85ff; +--vscode-debugConsole-warningForeground: #bf8803; +--vscode-debugConsole-errorForeground: #a1260d; +--vscode-debugConsole-sourceForeground: #616161; +--vscode-debugConsoleInputIcon-foreground: #616161; +--vscode-debugIcon-pauseForeground: #007acc; +--vscode-debugIcon-stopForeground: #a1260d; +--vscode-debugIcon-disconnectForeground: #a1260d; +--vscode-debugIcon-restartForeground: #388a34; +--vscode-debugIcon-stepOverForeground: #007acc; +--vscode-debugIcon-stepIntoForeground: #007acc; +--vscode-debugIcon-stepOutForeground: #007acc; +--vscode-debugIcon-continueForeground: #007acc; +--vscode-debugIcon-stepBackForeground: #007acc; +--vscode-notebook-cellBorderColor: #e8e8e8; +--vscode-notebook-focusedEditorBorder: #0090f1; +--vscode-notebookStatusSuccessIcon-foreground: #388a34; +--vscode-notebookEditorOverviewRuler-runningCellForeground: #388a34; +--vscode-notebookStatusErrorIcon-foreground: #a1260d; +--vscode-notebookStatusRunningIcon-foreground: #616161; +--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, 0.35); +--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, 0.31); +--vscode-notebook-selectedCellBorder: #e8e8e8; +--vscode-notebook-focusedCellBorder: #0090f1; +--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8; +--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, 0.08); +--vscode-notebook-cellInsertionIndicator: #0090f1; +--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, 0.4); +--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, 0.7); +--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, 0.6); +--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, 0.2); +--vscode-notebook-cellEditorBackground: #f3f3f3; +--vscode-notebook-editorBackground: #ffffff; +--vscode-interactive-activeCodeBorder: #007acc; +--vscode-interactive-inactiveCodeBorder: #e4e6f1; +--vscode-scm-historyItemAdditionsForeground: #587c0c; +--vscode-scm-historyItemDeletionsForeground: #ad0707; +--vscode-scm-historyItemStatisticsBorder: rgba(97, 97, 97, 0.2); +--vscode-scm-historyItemSelectedStatisticsBorder: rgba(255, 255, 255, 0.2); +--vscode-searchEditor-textInputBorder: #cecece; +--vscode-extensionButton-background: #007acc; +--vscode-extensionButton-foreground: #ffffff; +--vscode-extensionButton-hoverBackground: #0062a3; +--vscode-extensionButton-separator: rgba(255, 255, 255, 0.4); +--vscode-extensionButton-prominentBackground: #007acc; +--vscode-extensionButton-prominentForeground: #ffffff; +--vscode-extensionButton-prominentHoverBackground: #0062a3; +--vscode-extensionIcon-starForeground: #df6100; +--vscode-extensionIcon-verifiedForeground: #006ab1; +--vscode-extensionIcon-preReleaseForeground: #1d9271; +--vscode-extensionIcon-sponsorForeground: #b51e78; +--vscode-terminal-ansiBlack: #000000; +--vscode-terminal-ansiRed: #cd3131; +--vscode-terminal-ansiGreen: #00bc00; +--vscode-terminal-ansiYellow: #949800; +--vscode-terminal-ansiBlue: #0451a5; +--vscode-terminal-ansiMagenta: #bc05bc; +--vscode-terminal-ansiCyan: #0598bc; +--vscode-terminal-ansiWhite: #555555; +--vscode-terminal-ansiBrightBlack: #666666; +--vscode-terminal-ansiBrightRed: #cd3131; +--vscode-terminal-ansiBrightGreen: #14ce14; +--vscode-terminal-ansiBrightYellow: #b5ba00; +--vscode-terminal-ansiBrightBlue: #0451a5; +--vscode-terminal-ansiBrightMagenta: #bc05bc; +--vscode-terminal-ansiBrightCyan: #0598bc; +--vscode-terminal-ansiBrightWhite: #a5a5a5; +--vscode-gitDecoration-addedResourceForeground: #587c0c; +--vscode-gitDecoration-modifiedResourceForeground: #895503; +--vscode-gitDecoration-deletedResourceForeground: #ad0707; +--vscode-gitDecoration-renamedResourceForeground: #007100; +--vscode-gitDecoration-untrackedResourceForeground: #007100; +--vscode-gitDecoration-ignoredResourceForeground: #8e8e90; +--vscode-gitDecoration-stageModifiedResourceForeground: #895503; +--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707; +--vscode-gitDecoration-conflictingResourceForeground: #ad0707; +--vscode-gitDecoration-submoduleResourceForeground: #1258a7; +--vscode-rust_analyzer-syntaxTreeBorder: #b700ff; \ No newline at end of file diff --git a/ide/packages/panoptes/src/App.tsx b/ide/packages/panoptes/src/App.tsx index 7e34384..ffab0ce 100644 --- a/ide/packages/panoptes/src/App.tsx +++ b/ide/packages/panoptes/src/App.tsx @@ -48,9 +48,11 @@ const App = observer(({ config }: { config: PanoptesConfig }) => { const { payload, }: { - payload: SystemToPanoptesMsg; + payload: SystemToPanoptesMsg | undefined; } = e.data; + if (!payload) return; + console.debug("Received message from system", payload); if (isSysMsgOpenError(payload)) {