X-Git-Url: http://git.scottworley.com/tablify/blobdiff_plain/defb3aedeec6589c054ebf909d54ef1f94e5d52a..7a246d87bb2de224662bb80526fd5ed31be05cbe:/src/lib.rs
diff --git a/src/lib.rs b/src/lib.rs
index 2e9c7f6..bfcfdec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,10 +4,18 @@ use std::fmt::Write;
use std::io::BufRead;
use std::iter::Iterator;
-fn tally_marks(n: usize) -> String {
- let fives = { 0..n / 5 }.map(|_| 'ð¸');
- let ones = { 0..n % 5 }.map(|_| 'ð·');
- fives.chain(ones).collect()
+const TALLY_FONT: &str = "BabelStone Han";
+
+fn tally_marks(n: usize, mark: Option<&str>) -> HTML {
+ HTML(match mark {
+ None => {
+ let fives = { 0..n / 5 }.map(|_| 'ð¸');
+ let ones = { 0..n % 5 }.map(|_| 'ð·');
+ let marks: String = fives.chain(ones).collect();
+ format!("{marks}")
+ }
+ Some(m) => { 0..n }.map(|_| m).collect(),
+ })
}
#[derive(PartialEq, Eq, Debug)]
@@ -16,6 +24,7 @@ struct Config {
static_columns: Vec