diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..56dc9fd --- /dev/null +++ b/examples/README.md @@ -0,0 +1,114 @@ +# TestDrive-JSUI Examples + +This directory contains examples demonstrating TestDrive-JSUI as a standalone JavaScript library. + +--- + +## πŸ“ Examples + +### `standalone.html` - Pure JavaScript Demo + +**Purpose**: Proves TestDrive-JSUI can work as a pure JavaScript library with no backend. + +**Features**: +- βœ… Runs directly in browser (no server needed) +- βœ… Markdown rendering using marked.js +- βœ… Save/load to browser localStorage +- βœ… Download markdown files +- βœ… Zero dependencies on Python/Ruby/Java + +**How to Use**: +```bash +# Option 1: Open directly in browser +open examples/standalone.html + +# Option 2: From file system (works!) +# Just double-click the file + +# Option 3: Serve with any static server +python3 -m http.server 8000 +# Then visit: http://localhost:8000/examples/standalone.html +``` + +**What It Demonstrates**: +- JavaScript can handle all rendering +- No backend is required for core functionality +- Language adapters (Python/Ruby/Java) are truly optional + +--- + +## 🎯 Architecture Validation + +This standalone example validates the JavaScript-first architecture: + +### βœ… What Works Without Backend +- Markdown parsing (marked.js) +- HTML rendering +- UI display +- Content management +- Save/load (localStorage) +- File download + +### ⏸️ What's Still TODO (Full Implementation) +- Interactive editing UI +- Section-based editing +- Control panels (edit, debug, status) +- Keyboard shortcuts +- Themes +- Plugin system + +### πŸ”§ What Backend Adapters Provide (Optional) +- Asset serving at scale +- Server-side storage +- User authentication +- Multi-user collaboration +- Testing infrastructure + +--- + +## πŸš€ Next Steps + +### 1. Validate Proof of Concept +```bash +# Open standalone.html +# Verify markdown renders correctly +# Try save/load/download buttons +``` + +### 2. Full JavaScript Library +After validating the concept: +- Create `js/testdrive-jsui.js` main class +- Add interactive editing +- Implement control panels +- Full section management + +### 3. Refactor Python Adapter +Once JavaScript is complete: +- Simplify Python to thin adapter +- Remove HTML generation +- Keep only asset serving and testing + +--- + +## πŸ“ Notes + +**Performance**: Loading from CDN (marked.js) means internet connection required. For fully offline use, download marked.js locally. + +**Browser Support**: Works in all modern browsers (Chrome, Firefox, Safari, Edge). Requires ES6 support. + +**File Size**: The standalone example loads individual JS files. Production version would use bundled `testdrive-jsui.min.js` (~50KB). + +--- + +## 🀝 Contributing Examples + +Want to add an example? Please ensure it: +1. Works standalone (no complex build required) +2. Demonstrates a specific use case +3. Includes inline documentation +4. Works by just opening in browser + +--- + +**Status**: Proof of Concept +**Last Updated**: 2025-12-16 diff --git a/examples/standalone.html b/examples/standalone.html new file mode 100644 index 0000000..60893b7 --- /dev/null +++ b/examples/standalone.html @@ -0,0 +1,409 @@ + + + + + + TestDrive-JSUI - Standalone Demo + + + + +
+

πŸš€ TestDrive-JSUI Standalone Demo

+

+ A complete markdown editor running entirely in your browser - + no server, no backend, no build step required! +

+
+ +
+ πŸ“ Proof of Concept: This demonstrates TestDrive-JSUI as a pure JavaScript library. + All markdown rendering, UI, and editing happens in your browser using only JavaScript. +
+ +
+ + + + + +
+ +
+ +
+ + + + + + + + + + + + + + +