School lunch, Comic Sans and a small act of automation
A school lunch menu buried in a PDF, an unfortunate font choice, and a small Cloudflare app that puts lunch in the calendar. Some problems deserve automation.
A school lunch menu has a fairly straightforward job: tell people what is for lunch.
Ideally, it should be easy to find, readable on a phone, and available without mounting an expedition through the school website.
The restaurant contracted by the school appears to have taken a different creative direction. The menu is buried away, eventually emerging as a PDF. And when you finally find it, your reward is Comic Sans.
The food may be questionable. Tastes differ. People can disagree about a sauce.
But Comic Sans should be banned. Forever. There are limits to what a parent should have to digest.
So I built Matsedel KS: a small app that retrieves the lunch menu for Kunskapsskolan Helsingborg and makes it available as a calendar feed and a simple web app.
I cannot improve the cooking from a Cloudflare Worker. I can at least improve access to the evidence.
Finding lunch should not be a side quest
The menu PDF is linked from the school’s practical-information page, under “Matsedel”. That might be a reasonable filing system for the person maintaining the website. It is less convenient for someone asking a quick question on a phone.
“What is for lunch tomorrow?” should not require remembering where a document lives, downloading it, zooming in, finding the correct week, and admiring a typeface that has somehow survived every opportunity to retire.
The app reduces that to today’s and tomorrow’s lunch. If a calendar is more useful, there is an ICS subscription too.
The PDF can stay where it is. I would rather visit it automatically.
A surprisingly serious pipeline for lunch
The project runs on Cloudflare Workers. A scheduled task checks the school page twice a day and looks for the menu PDF link.
The refresh logic avoids unnecessary model calls. If the link is unchanged, it keeps the stored menu. If the link changes, it downloads the PDF and checks its SHA-256 hash. A new link pointing to identical content does not require another AI extraction either.
That distinction is useful: a document being uploaded again does not necessarily mean the meatballs have changed.
When there is new content to process, the pipeline looks like this:
School website
→ menu PDF
→ text with page positions
→ Claude Haiku through Cloudflare’s AI endpoint
→ validated JSON
→ Cloudflare KV
→ web app and calendar feed
The font does not make it through this process. A modest but meaningful victory.
The columns matter more than the font
The interesting extraction problem is the PDF’s layout. The menu uses columns, and simply pulling out the words can mix together weeks and weekdays that belong in different places.
The endpoint used by the app does not accept PDF input, so unpdf reads the document’s text layer first. Each line is sent with its position on the page, giving the model information about where the text belongs.
Claude turns that into structured menu data: week number, weekday, main dish, vegetarian alternative, and any note. The response is validated with Zod before it is stored.
Validation checks the shape of the data; it cannot certify that every dish has been assigned to the right day. The extraction still deserves checking against the source. AI can help untangle the columns, but it should not be allowed to improvise Thursday’s lunch.
If a PDF has no usable text layer, the extraction fails rather than pretending to have read it. During a scheduled refresh, that leaves the previously stored menu in place.
An old menu is not ideal. A confidently invented menu is worse.
Lunch, delivered to somewhere useful
The same stored data powers three endpoints:
/provides a small PWA showing today’s and tomorrow’s lunch./menu.jsonexposes the structured menu./lunch.icsprovides a calendar feed with an all-day event for each listed school day.
The calendar entries include the vegetarian alternative when one is available. They are marked as transparent, so lunch information does not block out the day as a meeting. Days explicitly marked as having no lunch are represented accordingly; fully closed weeks have no entries.
The app also provides installation help: a native install prompt where supported on Android and Chromium, and instructions for adding it to the home screen on iOS.
You can find it at lunch.martincrusell.com, or explore the source and setup instructions on GitHub.
Small inconveniences make good projects
This is the sort of automation I enjoy: a narrow problem, an existing source of information, and a way to make that information easier to use.
It does not need to replace the school website or become a platform. It just needs to answer a question without making someone hunt through a PDF first.
Whether lunch turns out to be a culinary triumph remains outside the scope of the application.
The Comic Sans ban, however, remains firmly on the roadmap. Forever is a perfectly reasonable retention policy.
Continue exploring