diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..96adbfd --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,97 @@ +# Markdown Live Preview - AI Coding Agent Instructions + +## Project Overview + +Single-page web application for live Markdown editing and preview using Monaco Editor, marked.js parser, and DOMPurify sanitization. Deployed to Firebase Hosting via Vite bundler. + +## Architecture + +### Core Components + +- **[src/main.js](../src/main.js)**: Single-file application with modular functions + - Monaco Editor initialization (lines 88-111) + - Markdown conversion pipeline: `marked.parse()` → `DOMPurify.sanitize()` (lines 135-141) + - State persistence via `storehouse-js` localStorage wrapper (lines 241-257) + - Split-pane divider with proportional resizing (lines 259-339) + +### Key Dependencies + +- `monaco-editor`: CDN ESM import (`https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/+esm`) +- `storehouse-js`: Custom fork from GitHub (`github:tanabe/Storehouse-js`) +- `marked` + `DOMPurify`: Markdown parsing and XSS protection pipeline + +## Development Workflow + +### Commands (prefer Makefile over npm) + +```bash +make setup # npm install +make dev # Vite dev server (HMR enabled) +make build # Production build to dist/ +make deploy # Firebase deploy (requires firebase-tools) +``` + +### Build System + +- **Vite**: No configuration file present; uses defaults +- **Output**: `dist/` directory (configured in [firebase.json](../firebase.json)) +- **Entry point**: [index.html](../index.html) with module script ` + - +
-