todo-viz
A checklist that writes straight back into the file.
I keep my whole task list in one Markdown file. This turns it into a clickable checklist in the browser, and every tick lands back in that same file. No database, no copy, no framework. The file stays the single source of truth, so anything else that reads it sees the change with no extra step.
before - [ ] Ship the todo-viz repo
click → PATCH /api/todo { line: 14, checked: true }
after - [x] 2026-08-16 — Ship the todo-viz repo
only the checkbox flips, date stamped, nothing else in the file is touched
The whole app is a small Python standard-library server plus one HTML page. It parses the Markdown into tasks, serves a checklist with a pinned "now" panel and section filters, and writes changes back through a tiny JSON API. Ticking stages a preview first, so nothing is saved until you hit Apply, which came out of an early version applying a test tick by accident.
The interesting part is writing into a file a human or another tool may edit at the same moment. Every write re-reads the file fresh, matches the target line by both its index and its exact text, and rejects with a conflict error if the file has shifted, instead of clobbering the wrong line. The change is a single checkbox flip plus an optional date stamp, written atomically through a temp file and a rename. No reflow, no re-sort, no stray whitespace.
- Python standard library
- atomic writes
- optimistic concurrency
- Markdown parsing
- vanilla JS
- zero dependencies
weekend hack
What it actually took. The easy version writes on every click and eventually corrupts the file the first time two things edit it at once. The real work was the safe-write path: read fresh, verify the line still matches, reject on conflict, write atomically. It is a small tool, but it treats a plain text file the way you would treat a shared record, because that is exactly what it is.