Add a Python/ML code playground and an AI-coding resources hub
Merged
SR
1mo ago+2647+2647+0123456789012345678901234567890123456789-5-5-0123456789
Split out of #57 (as requested) and branched off main, so it can be reviewed and merged on its own.
What's in it
Code playground โ /playground
- Real Python in the browser with Pyodide 0.27.7, running in a Web Worker and loaded lazily (nothing is fetched until the first Run)
- NumPy, pandas, scikit-learn and matplotlib load on import; figures render as images
- Stop button plus a 30s limit for runaway code, friendly tracebacks with a hint and the line number, eight starters (including an iris classifier and a plot)
- Share puts the code in the URL hash only; nothing is sent anywhere
input()takes answers up front (true pausing needs cross-origin isolation headers)
Run buttons in lessons
- Python code blocks (
.pyor "Python" labels) get a Run button that opens an editable inline runner under the block - REPL (
>>>), terminal and traceback blocks are excluded; the MLscaling.pyexcerpt is opted out because it can't run on its own
AI-coding resources โ /resources/ai-coding
- Tool picks with official links (no prices), 8 copyable prompts that teach rather than answer, a healthy AI workflow, safety tips, and a glossary
Also
- Both pages added to the header's More menu, the footer's Learn column and the sitemap, each with its own share image
- About: Vibhav's bio reflects his role
Relationship to #57
Split out of #57 and now updated on top of it (#57 is merged). The one expected overlap, CodeBlock.tsx, is resolved: it's the redesigned block plus the Run button. The playground and resources pages use the redesign's motion components again, and the temporary tools.css is gone since main has those styles.
Checks
npm run lint, typecheck, learn:check and next build pass. Verified in the browser: starters including NumPy run, Run buttons appear on Python lesson blocks, and the resources page's copy buttons are styled.
๐ค Generated with Claude Code