aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--html/style.css1
-rw-r--r--src/main.rs8
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#"<p>{}</p>"#, be)?;
}
- writeln!(f, r#"<p class="chars">{}</p>"#, ex.chars.inter(&batch.chars).to_string())?;
+ writeln!(f, r#"<p class="chars">"#)?;
+ for c in ex.chars.inter(&batch.chars).chars().iter() {
+ writeln!(f, r#"<a href="https://jisho.org/search/{}%20%23kanji">{}</a>"#, c, c)?;
+ }
+ writeln!(f, r#"</p>"#)?;
for be in expl_all {
writeln!(f, r#"<p>{}</p>"#, be)?;
}