X-Git-Url: http://git.scottworley.com/tablify/blobdiff_plain/74bd4cd1e2035284040bbaf894c271423b7a5455..7a246d87bb2de224662bb80526fd5ed31be05cbe:/src/lib.rs
diff --git a/src/lib.rs b/src/lib.rs
index 357a7ee..bfcfdec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,10 +1,88 @@
use std::borrow::ToOwned;
-use std::collections::HashMap;
+use std::collections::{HashMap, HashSet};
use std::fmt::Write;
use std::io::BufRead;
use std::iter::Iterator;
-pub struct Config {}
+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)]
+struct Config {
+ column_threshold: usize,
+ static_columns: Vec