mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-22 13:41:10 +00:00
Add spoiler tags (fixes #78)
This commit is contained in:
parent
8fa4fb1078
commit
444be44008
4 changed files with 14 additions and 1 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -1735,6 +1735,7 @@ dependencies = [
|
||||||
"leptos_router",
|
"leptos_router",
|
||||||
"log",
|
"log",
|
||||||
"markdown-it",
|
"markdown-it",
|
||||||
|
"markdown-it-block-spoiler",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"rand",
|
"rand",
|
||||||
|
@ -2293,6 +2294,16 @@ dependencies = [
|
||||||
"unicode-general-category",
|
"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]]
|
[[package]]
|
||||||
name = "matchit"
|
name = "matchit"
|
||||||
version = "0.7.3"
|
version = "0.7.3"
|
||||||
|
|
|
@ -81,6 +81,7 @@ smart-default = "0.7.1"
|
||||||
tower-layer = "0.3.3"
|
tower-layer = "0.3.3"
|
||||||
katex = { version = "0.4", default-features = false }
|
katex = { version = "0.4", default-features = false }
|
||||||
include_dir = "0.7.4"
|
include_dir = "0.7.4"
|
||||||
|
markdown-it-block-spoiler = "1.0.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pretty_assertions = "1.4.1"
|
pretty_assertions = "1.4.1"
|
||||||
|
|
|
@ -72,7 +72,7 @@ async fn serve_wasm() -> MyResult<impl IntoResponse> {
|
||||||
|
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
async fn get_font(Path(font): Path<String>) -> MyResult<impl IntoResponse> {
|
async fn get_font(Path(font): Path<String>) -> MyResult<impl IntoResponse> {
|
||||||
let mut headers = HeaderMap::new();
|
let headers = HeaderMap::new();
|
||||||
let font_dir = include_dir!("assets/fonts");
|
let font_dir = include_dir!("assets/fonts");
|
||||||
let file = font_dir.get_file(font).ok_or(anyhow!("invalid font"))?;
|
let file = font_dir.get_file(font).ok_or(anyhow!("invalid font"))?;
|
||||||
Ok((headers, file.contents()))
|
Ok((headers, file.contents()))
|
||||||
|
|
|
@ -33,6 +33,7 @@ fn markdown_parser() -> MarkdownIt {
|
||||||
markdown_it::plugins::extra::strikethrough::add(&mut parser);
|
markdown_it::plugins::extra::strikethrough::add(&mut parser);
|
||||||
markdown_it::plugins::extra::tables::add(&mut parser);
|
markdown_it::plugins::extra::tables::add(&mut parser);
|
||||||
markdown_it::plugins::extra::typographer::add(&mut parser);
|
markdown_it::plugins::extra::typographer::add(&mut parser);
|
||||||
|
markdown_it_block_spoiler::add(&mut parser);
|
||||||
parser.inline.add_rule::<ArticleLinkScanner>();
|
parser.inline.add_rule::<ArticleLinkScanner>();
|
||||||
parser.inline.add_rule::<MathEquationScanner>();
|
parser.inline.add_rule::<MathEquationScanner>();
|
||||||
parser
|
parser
|
||||||
|
|
Loading…
Reference in a new issue