3 ms·
This looks a lot like the approach we use in my pedagogical library Drafter: https://drafter-edu.github.io/drafter/quickstart/quickstart.html https://drafter-ed
by acbart 1y ago
This looks a lot like the approach we use in my pedagogical library Drafter: https://drafter-edu.github.io/drafter/quickstart/quickstart.html https://drafter-edu.github.io/drafter/quickstart/quickstart....
Route functions consume a State object (arbitrarily whatever type you want) and return a Page object, which has the new State and a list of component objects, which are dataclasses that can be serialized to strings of HTML. We provide functions for Button, CheckBox, BulletedList, etc.
So far, it's been pretty effective for our CS1 course to let students develop nicely decomposed web applications in just Python. We can deploy through Github Pages thanks to our custom Skulpt bindings, and it even makes unit testing quite easy.