commit 7062ef2955bdb21ae93f47b35eaf021cb7fbb6c1
parent 04685fead72fb76fda5cb21bb0c8302d077f5aca
Author: Hunter
Date:   Sun,  8 Mar 2026 23:49:10 -0400

add run.py

Diffstat:
Mreadme.md | 7++++---
Arun.py | 15+++++++++++++++
2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/readme.md b/readme.md @@ -5,13 +5,14 @@ turn mountains into molehills (then molehills into anthills) with <b>matryoshka</b>,<br> the nested todo list that breaks complex tasks into manageable subtasks. -<i><b>try it now <a href="https://hunterirving.github.io/matryoshka/">in your browser</a>!</b></i> (physical keyboard required) +<i><b>try it now <a href="https://hunterirving.github.io/matryoshka/">in your browser</a>!</b></i> (physical keyboard required). + +alternatively, you can use ```./run.py``` to run matryoshka locally, or try installing it as a <a href="https://hunterirving.github.io/web_workshop/pages/pwa">Progressive Web App</a> that works completely offline. ### key features - unlimited subtask depth - intuitive keyboard controls -- automatic saving using browser's local storage -- installable as a <a href="https://hunterirving.github.io/web_workshop/pages/pwa">Progressive Web App</a> +- automatically saves as you edit ### quickstart 1. press the `Return` / `Enter` key to add subtasks to the root "todo" task diff --git a/run.py b/run.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import http.server, webbrowser, threading, signal + +PORT = 8000 +server = http.server.HTTPServer(("", PORT), http.server.SimpleHTTPRequestHandler) + +def shutdown(sig, frame): + print("\nShutting down...") + threading.Thread(target=server.shutdown).start() + +signal.signal(signal.SIGINT, shutdown) +threading.Timer(0.5, lambda: webbrowser.open(f"http://localhost:{PORT}")).start() +print(f"Serving on http://localhost:{PORT} (Ctrl+C to stop)") +server.serve_forever()