1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2025-01-27 19:25:49 +00:00

no markdown

o
This commit is contained in:
Felix Ableitner 2024-11-20 15:34:45 +01:00
parent 14e6382765
commit c2d5bdcd52
3 changed files with 26 additions and 650 deletions

500
Cargo.lock generated
View file

@ -14,7 +14,7 @@ dependencies = [
"base64 0.22.1",
"bytes",
"chrono",
"derive_builder 0.20.2",
"derive_builder",
"diesel",
"dyn-clone",
"enum_delegate",
@ -24,7 +24,7 @@ dependencies = [
"http-signature-normalization",
"http-signature-normalization-reqwest",
"httpdate",
"itertools 0.13.0",
"itertools",
"moka",
"once_cell",
"pin-project-lite",
@ -128,12 +128,6 @@ version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775"
[[package]]
name = "argparse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47"
[[package]]
name = "arraydeque"
version = "0.5.1"
@ -340,36 +334,6 @@ dependencies = [
"zeroize",
]
[[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"
@ -431,12 +395,6 @@ dependencies = [
"shlex",
]
[[package]]
name = "cesu8"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -507,7 +465,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf"
dependencies = [
"async-trait",
"convert_case 0.6.0",
"convert_case",
"json5",
"nom",
"pathdiff",
@ -591,12 +549,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b"
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "convert_case"
version = "0.6.0"
@ -625,7 +577,7 @@ checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9"
dependencies = [
"cookie",
"document-features",
"idna 1.0.3",
"idna",
"log",
"publicsuffix",
"serde",
@ -660,15 +612,6 @@ dependencies = [
"libc",
]
[[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-channel"
version = "0.5.13"
@ -719,16 +662,6 @@ dependencies = [
"darling_macro 0.13.4",
]
[[package]]
name = "darling"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
dependencies = [
"darling_core 0.14.4",
"darling_macro 0.14.4",
]
[[package]]
name = "darling"
version = "0.20.10"
@ -753,20 +686,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "darling_core"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
dependencies = [
"fnv",
"ident_case",
"proc-macro2",
"quote",
"strsim 0.10.0",
"syn 1.0.109",
]
[[package]]
name = "darling_core"
version = "0.20.10"
@ -792,17 +711,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "darling_macro"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
dependencies = [
"darling_core 0.14.4",
"quote",
"syn 1.0.109",
]
[[package]]
name = "darling_macro"
version = "0.20.10"
@ -860,17 +768,6 @@ dependencies = [
"powerfmt",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "derive-where"
version = "1.2.7"
@ -882,34 +779,13 @@ dependencies = [
"syn 2.0.87",
]
[[package]]
name = "derive_builder"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8"
dependencies = [
"derive_builder_macro 0.12.0",
]
[[package]]
name = "derive_builder"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947"
dependencies = [
"derive_builder_macro 0.20.2",
]
[[package]]
name = "derive_builder_core"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f"
dependencies = [
"darling 0.14.4",
"proc-macro2",
"quote",
"syn 1.0.109",
"derive_builder_macro",
]
[[package]]
@ -924,36 +800,13 @@ dependencies = [
"syn 2.0.87",
]
[[package]]
name = "derive_builder_macro"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e"
dependencies = [
"derive_builder_core 0.12.0",
"syn 1.0.109",
]
[[package]]
name = "derive_builder_macro"
version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
dependencies = [
"derive_builder_core 0.20.2",
"syn 2.0.87",
]
[[package]]
name = "derive_more"
version = "0.99.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce"
dependencies = [
"convert_case 0.4.0",
"proc-macro2",
"quote",
"rustc_version",
"derive_builder_core",
"syn 2.0.87",
]
@ -963,7 +816,7 @@ version = "2.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "158fe8e2e68695bd615d7e4f3227c0727b151330d3e253b525086c348d055d5e"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"byteorder",
"chrono",
"diesel_derives",
@ -1095,12 +948,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "downcast-rs"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
[[package]]
name = "drain_filter_polyfill"
version = "0.1.3"
@ -1121,25 +968,6 @@ dependencies = [
"syn 2.0.87",
]
[[package]]
name = "ducc"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41bc1f8a30712eb6a7454f85747f218d9dfb41d173bb223a8c4f18daff829207"
dependencies = [
"cesu8",
"ducc-sys",
]
[[package]]
name = "ducc-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cdea834bf6a0fde522374db4404695c5f0465fc0ee814f2878d76eaabd4ffed"
dependencies = [
"cc",
]
[[package]]
name = "dyn-clone"
version = "1.0.17"
@ -1170,12 +998,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "entities"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca"
[[package]]
name = "enum_delegate"
version = "0.2.0"
@ -1256,32 +1078,12 @@ dependencies = [
"pin-project-lite",
]
[[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 = "fastrand"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
[[package]]
name = "flate2"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -1430,16 +1232,6 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
name = "github-slugger"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "721820f4eab1c427d482e144b63288754d9872fb7f0d72d73ab101008ef43147"
dependencies = [
"once_cell",
"regex",
]
[[package]]
name = "gloo-net"
version = "0.6.0"
@ -1783,19 +1575,12 @@ dependencies = [
"hex",
"http",
"jsonwebtoken",
"katex",
"leptos",
"leptos-use",
"leptos_axum",
"leptos_meta",
"leptos_router",
"log",
"markdown-it",
"markdown-it-block-spoiler",
"markdown-it-footnote",
"markdown-it-heading-anchors",
"markdown-it-sub",
"markdown-it-sup",
"once_cell",
"pretty_assertions",
"rand",
@ -1943,16 +1728,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
dependencies = [
"unicode-bidi",
"unicode-normalization",
]
[[package]]
name = "idna"
version = "1.0.3"
@ -2011,15 +1786,6 @@ version = "2.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708"
[[package]]
name = "itertools"
version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
dependencies = [
"either",
]
[[package]]
name = "itertools"
version = "0.13.0"
@ -2070,21 +1836,6 @@ dependencies = [
"simple_asn1",
]
[[package]]
name = "katex"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bdbc7a1823f188f56ac9486993536b70a2686a58d47095dcc10507a7d242bf5"
dependencies = [
"cfg-if",
"derive_builder 0.12.0",
"ducc",
"itertools 0.10.5",
"js-sys",
"thiserror 1.0.69",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -2250,9 +2001,9 @@ checksum = "0e948a21600d13a6e91d9a0fb56de9c58692f79890caeaec7dabb1cd63e8ec92"
dependencies = [
"attribute-derive",
"cfg-if",
"convert_case 0.6.0",
"convert_case",
"html-escape",
"itertools 0.13.0",
"itertools",
"leptos_hot_reload",
"prettyplease",
"proc-macro-error2",
@ -2354,21 +2105,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee"
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linkify"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dfa36d52c581e9ec783a7ce2a5e0143da6237be5811a0b3153fedfdbe9f780"
dependencies = [
"memchr",
]
[[package]]
name = "linux-raw-sys"
version = "0.4.14"
@ -2426,93 +2162,12 @@ dependencies = [
"quote",
]
[[package]]
name = "markdown-it"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f99c010929c8217b2dc0940954267a2e15a15f17cb309cd1f299e21933f84fac"
dependencies = [
"argparse",
"const_format",
"derivative",
"derive_more",
"downcast-rs",
"entities",
"html-escape",
"linkify",
"mdurl",
"once_cell",
"readonly",
"regex",
"stacker",
"syntect",
"unicode-general-category",
]
[[package]]
name = "markdown-it-block-spoiler"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "008a8e4184fd08b5dca0f2b5b2ef8f126c1e83ca797c44ee41f8d7765951360c"
dependencies = [
"itertools 0.13.0",
"markdown-it",
]
[[package]]
name = "markdown-it-footnote"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6679ab967fbc45b290b25fb477af7556bf6825feec208a970585e6bb9aae3be"
dependencies = [
"markdown-it",
]
[[package]]
name = "markdown-it-heading-anchors"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c8c71a46fc41bf2fdac133c188c1477562b7bcd1be3981e84fc81cfc2e515fe"
dependencies = [
"github-slugger",
"markdown-it",
]
[[package]]
name = "markdown-it-sub"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8abe3aa8927af2314644b3aae37393241a229e869ff9c95ac640749e08357d2a"
dependencies = [
"markdown-it",
]
[[package]]
name = "markdown-it-sup"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ae949e78c7a615f88a47019d51b65962bfc5c4cbc65fa81eae8b9b2506d1cb1"
dependencies = [
"markdown-it",
]
[[package]]
name = "matchit"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "mdurl"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5736ba45bbac8f7ccc99a897f88ce85e508a18baec973a040f2514e6cdbff0d2"
dependencies = [
"idna 0.3.0",
"once_cell",
"regex",
]
[[package]]
name = "memchr"
version = "2.7.4"
@ -2760,7 +2415,7 @@ version = "0.10.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"cfg-if",
"foreign-types",
"libc",
@ -2984,19 +2639,6 @@ version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[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",
"serde",
"time",
]
[[package]]
name = "powerfmt"
version = "0.2.0"
@ -3136,22 +2778,13 @@ version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac"
[[package]]
name = "psm"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810"
dependencies = [
"cc",
]
[[package]]
name = "publicsuffix"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf"
dependencies = [
"idna 1.0.3",
"idna",
"psl-types",
]
@ -3170,15 +2803,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "quick-xml"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2"
dependencies = [
"memchr",
]
[[package]]
name = "quinn"
version = "0.11.6"
@ -3309,7 +2933,7 @@ version = "11.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0"
dependencies = [
"bitflags 2.6.0",
"bitflags",
]
[[package]]
@ -3340,7 +2964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81fa994eaec6638c22faeedd4524cbd5a3653e7f32a67e130a60a0c8c9e1ee81"
dependencies = [
"guardian",
"itertools 0.13.0",
"itertools",
"or_poisoned",
"paste",
"reactive_graph",
@ -3354,31 +2978,20 @@ version = "0.1.0-rc1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9d7cfe1c6d9f1005605ac7c928aef7e037d6808d6eda0429e73f0ca90cb9cb5"
dependencies = [
"convert_case 0.6.0",
"convert_case",
"proc-macro-error2",
"proc-macro2",
"quote",
"syn 2.0.87",
]
[[package]]
name = "readonly"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a25d631e41bfb5fdcde1d4e2215f62f7f0afa3ff11e26563765bd6ea1d229aeb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.87",
]
[[package]]
name = "redox_syscall"
version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
dependencies = [
"bitflags 2.6.0",
"bitflags",
]
[[package]]
@ -3511,7 +3124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
dependencies = [
"base64 0.21.7",
"bitflags 2.6.0",
"bitflags",
"serde",
"serde_derive",
]
@ -3588,7 +3201,7 @@ version = "0.38.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"errno",
"libc",
"linux-raw-sys",
@ -3689,7 +3302,7 @@ version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
@ -3839,7 +3452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4230cd52992681cc370885a613a5aad9fb56d61995b789de5c42dc55ff628e98"
dependencies = [
"const_format",
"convert_case 0.6.0",
"convert_case",
"proc-macro2",
"quote",
"syn 2.0.87",
@ -3971,19 +3584,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "stacker"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b"
dependencies = [
"cc",
"cfg-if",
"libc",
"psm",
"windows-sys 0.59.0",
]
[[package]]
name = "strsim"
version = "0.10.0"
@ -4062,35 +3662,13 @@ dependencies = [
"syn 2.0.87",
]
[[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 1.0.69",
"walkdir",
"yaml-rust",
]
[[package]]
name = "system-configuration"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"core-foundation",
"system-configuration-sys",
]
@ -4118,7 +3696,7 @@ dependencies = [
"futures",
"html-escape",
"indexmap",
"itertools 0.13.0",
"itertools",
"js-sys",
"linear-map",
"next_tuple",
@ -4404,7 +3982,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"bytes",
"futures-util",
"http",
@ -4429,7 +4007,7 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97"
dependencies = [
"bitflags 2.6.0",
"bitflags",
"bytes",
"futures-util",
"http",
@ -4560,33 +4138,12 @@ version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df"
[[package]]
name = "unicode-bidi"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893"
[[package]]
name = "unicode-general-category"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7"
[[package]]
name = "unicode-ident"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]]
name = "unicode-normalization"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
dependencies = [
"tinyvec",
]
[[package]]
name = "unicode-segmentation"
version = "1.12.0"
@ -4612,7 +4169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada"
dependencies = [
"form_urlencoded",
"idna 1.0.3",
"idna",
"percent-encoding",
"serde",
]
@ -4970,15 +4527,6 @@ version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984"
[[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 = "yaml-rust2"
version = "0.8.1"

View file

@ -17,7 +17,6 @@ ssr = [
"leptos_axum",
"activitypub_federation",
"jsonwebtoken",
"katex/duktape",
"leptos/ssr",
"leptos-use/ssr",
"leptos-use/axum",
@ -31,7 +30,7 @@ ssr = [
"tower-layer",
"reqwest","diesel-derive-newtype"
]
hydrate = ["leptos/hydrate", "katex/wasm-js", "gloo-net"]
hydrate = ["leptos/hydrate", "gloo-net"]
# This profile significantly speeds up build time. If debug info is needed you can comment the line
# out temporarily, but make sure to leave this in the main branch.
@ -79,14 +78,7 @@ tracing = "0.1.40"
once_cell = "1.20.2"
console_error_panic_hook = "0.1.7"
time = "0.3.36"
markdown-it = "0.6.1"
smart-default = "0.7.1"
katex = { version = "0.4", default-features = false }
markdown-it-block-spoiler = "1.0.0"
markdown-it-heading-anchors = "0.3.0"
markdown-it-footnote = "0.2.0"
markdown-it-sub = "1.0.0"
markdown-it-sup = "1.0.0"
leptos-use = "0.14.0-rc3"
codee = "0.2.0"
wasm-bindgen = "=0.2.95"

View file

@ -1,167 +1,3 @@
use katex;
use markdown_it::{
parser::inline::{InlineRule, InlineState},
plugins::cmark::block::{heading::ATXHeading, lheading::SetextHeader},
MarkdownIt,
Node,
NodeValue,
Renderer,
};
use once_cell::sync::OnceCell;
pub fn render_markdown(text: &str) -> String {
static INSTANCE: OnceCell<MarkdownIt> = OnceCell::new();
let mut parsed = INSTANCE.get_or_init(markdown_parser).parse(text);
// Make markdown headings one level smaller, so that h1 becomes h2 etc, and markdown titles
// are smaller than page title.
parsed.walk_mut(|node, _| {
if let Some(heading) = node.cast_mut::<ATXHeading>() {
heading.level += 1;
}
if let Some(heading) = node.cast_mut::<SetextHeader>() {
heading.level += 1;
}
});
parsed.render()
}
fn markdown_parser() -> MarkdownIt {
let mut parser = MarkdownIt::new();
markdown_it::plugins::cmark::add(&mut parser);
markdown_it_heading_anchors::add(&mut parser);
markdown_it_footnote::add(&mut parser);
markdown_it::plugins::extra::strikethrough::add(&mut parser);
markdown_it::plugins::extra::tables::add(&mut parser);
markdown_it::plugins::extra::typographer::add(&mut parser);
markdown_it_block_spoiler::add(&mut parser);
markdown_it_sub::add(&mut parser);
markdown_it_sup::add(&mut parser);
parser.inline.add_rule::<ArticleLinkScanner>();
parser.inline.add_rule::<MathEquationScanner>();
parser
}
#[derive(Debug)]
pub struct ArticleLink {
title: String,
domain: String,
}
// This defines how your custom node should be rendered.
impl NodeValue for ArticleLink {
fn render(&self, node: &Node, fmt: &mut dyn Renderer) {
let mut attrs = node.attrs.clone();
let link = format!("/article/{}@{}", self.title, self.domain);
attrs.push(("href", link));
fmt.open("a", &attrs);
fmt.text(&self.title);
fmt.close("a");
}
}
struct ArticleLinkScanner;
impl InlineRule for ArticleLinkScanner {
const MARKER: char = '[';
/// Find `[[Title@example.com]], return the position and split title/domain.
fn run(state: &mut InlineState) -> Option<(Node, usize)> {
let input = &state.src[state.pos..state.pos_max];
if !input.starts_with("[[") {
return None;
}
const SEPARATOR_LENGTH: usize = 2;
input.find("]]").and_then(|length| {
let start = state.pos + SEPARATOR_LENGTH;
let i = start + length - SEPARATOR_LENGTH;
let content = &state.src[start..i];
content.split_once('@').map(|(title, domain)| {
let node = Node::new(ArticleLink {
title: title.to_string(),
domain: domain.to_string(),
});
(node, length + SEPARATOR_LENGTH)
})
})
}
}
#[derive(Debug)]
pub struct MathEquation {
equation: String,
display_mode: bool,
}
impl NodeValue for MathEquation {
fn render(&self, _node: &Node, fmt: &mut dyn Renderer) {
let opts = katex::Opts::builder()
.throw_on_error(false)
.display_mode(self.display_mode)
.build()
.unwrap();
let katex_equation = katex::render_with_opts(&self.equation, opts).unwrap();
fmt.text_raw(&katex_equation)
}
}
struct MathEquationScanner;
impl InlineRule for MathEquationScanner {
const MARKER: char = '$';
fn run(state: &mut InlineState) -> Option<(Node, usize)> {
let input = &state.src[state.pos..state.pos_max];
if !input.starts_with("$$") {
return None;
}
let mut display_mode = false;
if input.starts_with("$$\n") || input.starts_with("$$ ") {
display_mode = true;
}
const SEPARATOR_LENGTH: usize = 2;
input[SEPARATOR_LENGTH - 1..].find("$$").map(|length| {
let start = state.pos + SEPARATOR_LENGTH;
let i = start + length - SEPARATOR_LENGTH + 1;
if start > i {
return None;
}
let content = &state.src[start..i];
let node = Node::new(MathEquation {
equation: content.to_string(),
display_mode,
});
Some((node, length + SEPARATOR_LENGTH + 1))
})?
}
}
#[test]
fn test_markdown_article_link() {
let parser = markdown_parser();
let rendered = parser
.parse("some text [[Title@example.com]] and more")
.render();
assert_eq!(
"<p>some text <a href=\"/article/Title@example.com\">Title</a> and more</p>\n",
rendered
);
}
#[test]
fn test_markdown_equation_katex() {
let parser = markdown_parser();
let rendered = parser
.parse("here is a math equation: $$E=mc^2$$. Pretty cool, right?")
.render();
assert_eq!(
"<p>here is a math equation: ".to_owned()
+ &katex::render("E=mc^2").unwrap()
+ ". Pretty cool, right?</p>\n",
rendered
);
text.to_string()
}