From a5b0ba4f4013fedf7b291b5801c0fcce22a35a60 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 21 Jul 2023 22:07:22 +0200 Subject: add kanji links to jisho.org --- html/style.css | 1 + src/main.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/html/style.css b/html/style.css index 7fdbc5e..35c7948 100644 --- a/html/style.css +++ b/html/style.css @@ -1,5 +1,6 @@ a { color: blue; + text-decoration: none; } tr:hover { diff --git a/src/main.rs b/src/main.rs index 1572e2e..e081454 100644 --- a/src/main.rs +++ b/src/main.rs @@ -362,11 +362,9 @@ fn format_batch_aux<'a>(dict_idx: &DictIndex<'a>, count: usize, i: usize, batch: if !wchars.intersects(&ex.chars) { continue; } - println!("{}", w); if let Some(ents) = dict_idx.get(w) { for ent in ents.iter() { let s = dict_str(w, ent); - println!("{}: {}", w, s); if wchars.intersects(&batch.chars) { expl_batch.push(s); } else { @@ -378,7 +376,11 @@ fn format_batch_aux<'a>(dict_idx: &DictIndex<'a>, count: usize, i: usize, batch: for be in expl_batch { writeln!(f, r#"

{}

"#, be)?; } - writeln!(f, r#"

{}

"#, ex.chars.inter(&batch.chars).to_string())?; + writeln!(f, r#"

"#)?; + for c in ex.chars.inter(&batch.chars).chars().iter() { + writeln!(f, r#"{}"#, c, c)?; + } + writeln!(f, r#"

"#)?; for be in expl_all { writeln!(f, r#"

{}

"#, be)?; } -- cgit v1.2.3