From 62f74f736ccf49bce37ded8633ecf0738321dc5d Mon Sep 17 00:00:00 2001 From: Natxo <1172351+natxocc@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:57:58 +0100 Subject: [PATCH] Create README.md for SigPro Playground Add comprehensive README for SigPro Playground with features, usage guide, examples, and troubleshooting. --- PlayGround/Readme.md | 208 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 PlayGround/Readme.md diff --git a/PlayGround/Readme.md b/PlayGround/Readme.md new file mode 100644 index 0000000..932fc16 --- /dev/null +++ b/PlayGround/Readme.md @@ -0,0 +1,208 @@ +# SigPro Playground 🚀 + +An interactive online environment to experiment with **SigPro** - a minimalist reactive library for building reactive user interfaces directly in the browser. + + + +## 🌟 Features + +- **Zero Setup** - No installation required, works directly in the browser +- **Live Preview** - See your code results in real-time +- **Built-in SigPro** - Full library included with `$`, `$$`, `html`, `$component`, and `$router` +- **Error Console** - Instant feedback on syntax and runtime errors +- **Code Sharing** - Generate shareable URLs with your code +- **Auto-execution** - Runs automatically as you type (with debounce) +- **Keyboard Shortcuts** - Ctrl+Enter to manually execute +- **Clean Interface** - Modern dark-themed editor inspired by VS Code + +## 🎮 Quick Start + +### Online Version +Simply open the `play.html` file in your web browser and start coding! + +### Write Your First Code + +```javascript +// Create reactive signals +const name = $('World'); +const count = $(0); + +// Create an effect that reacts to changes +$$(() => { + document.body.innerHTML = ` +
Count: ${count()}
+ + `; +}); + +// Update signals and watch the magic happen +setTimeout(() => name('SigPro'), 2000); +``` + +## 📖 Usage Guide + +### The Editor Panel + +- **Write Code** - The left panel contains the code editor with syntax highlighting +- **Auto-execute** - Code runs automatically 1 second after you stop typing +- **Manual Run** - Click the "Run" button or press `Ctrl+Enter` +- **Format** - Click "Format" to beautify your code (coming soon) +- **Share** - Generate a shareable link with your current code +- **Reset** - Restore the default example + +### The Preview Panel + +- **Live Results** - See your code output in real-time +- **Error Display** - Any errors appear in the console at the bottom +- **Clean Slate** - Each execution starts with a fresh environment + +### Keyboard Shortcuts + +| Shortcut | Action | +|----------|--------| +| `Ctrl + Enter` | Execute code manually | +| `Ctrl + S` | Save current code (coming soon) | + +## 🎯 Example Code Snippets + +### Basic Counter +```javascript +const counter = $(0); + +setInterval(() => { + counter(c => c + 1); +}, 1000); + +$$(() => { + document.body.innerHTML = `You typed: ${text}
+Price: $${price()}
+Quantity: ${quantity()}
+Total: $${total()}
+ + +