seriesof: the series a book belongs to, and which volume this is

This commit is contained in:
funkpower
2026-09-19 19:03:47 -04:00
parent e9d22ee1fa
commit 05b363ea8a
25 changed files with 1406 additions and 4 deletions
+14 -1
View File
@@ -19,7 +19,7 @@ type Written = Result<Vec<String>, String>;
type Job = (&'static str, fn() -> Written);
fn main() -> ExitCode {
let jobs: [Job; 17] = [
let jobs: [Job; 18] = [
("tokens", tokens),
("unescape", unescape),
("chunkmd", chunkmd),
@@ -37,6 +37,7 @@ fn main() -> ExitCode {
("mdsplit", mdsplit),
("avplan", avplan),
("pdfgutter", pdfgutter),
("seriesof", seriesof),
];
for (name, job) in jobs {
@@ -219,6 +220,18 @@ fn cueseg() -> Written {
Ok(written)
}
fn seriesof() -> Written {
let dir = parity::golden("seriesof");
std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?;
let cases = parity::dir().join("cases/seriesof/cases.ndjson");
let text = std::fs::read_to_string(&cases).map_err(|e| e.to_string())?;
let answers = parity::run_oracle("series.py", &text)?;
let path = dir.join("cases.ndjson");
std::fs::write(&path, answers).map_err(|e| e.to_string())?;
Ok(vec![path.display().to_string()])
}
fn pdfgutter() -> Written {
let dir = parity::golden("pdfgutter");
std::fs::create_dir_all(&dir).map_err(|e| e.to_string())?;