{"id":35185527,"url":"https://github.com/qduc/md-preview","last_synced_at":"2026-05-17T23:31:55.451Z","repository":{"id":328099307,"uuid":"1113827781","full_name":"qduc/md-preview","owner":"qduc","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-11T08:05:33.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-11T22:00:06.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qduc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-10T14:17:35.000Z","updated_at":"2025-12-11T08:05:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/qduc/md-preview","commit_stats":null,"previous_names":["qduc/md-preview"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/qduc/md-preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fmd-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fmd-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fmd-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fmd-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qduc","download_url":"https://codeload.github.com/qduc/md-preview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fmd-preview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33159099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-29T04:57:50.272Z","updated_at":"2026-05-17T23:31:55.446Z","avatar_url":"https://github.com/qduc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MD Preview\n\nA simple, client-side Markdown editor and previewer built with React and Vite. Create, edit, and manage multiple notes with live rendering and local persistence.\n\n## Features\n\n- **Live Markdown Preview**: Real-time rendering of Markdown as you type.\n- **Note Management**: Create, switch between, and delete notes.\n- **Persistent Storage**: Notes are saved to your browser's localStorage.\n- **Responsive Design**: Clean interface suitable for quick note-taking and editing.\n\n## Technologies\n\n- React 19 (with hooks)\n- Vite 7 (for development and build)\n- Lucide React (for icons)\n- Marked 17 (GitHub Flavored Markdown parser)\n- DOMPurify 3 (XSS protection for rendered HTML)\n- Vitest 4 (unit testing framework)\n- Testing Library (React component testing)\n\n## Installation\n\nClone the repository and install dependencies:\n\n```bash\ngit clone \u003crepository-url\u003e\ncd md-preview\nnpm install\n```\n\n## Usage\n\nStart the development server:\n\n```bash\nnpm run dev\n```\n\nOpen your browser and navigate to `http://localhost:5173`. Start creating notes!\n\n- **Adding Notes**: Click the \"New Note\" button (Plus icon).\n- **Switching Notes**: Use the dropdown to select a note.\n- **Editing**: Type in the textarea; the preview updates automatically.\n- **Deleting Notes**: Click the trash icon next to a note.\n\nNotes are automatically saved to localStorage, so they'll persist across browser sessions.\n\n## Development\n\n- **Linting**: `npm run lint` – Runs ESLint to check for code style issues.\n- **Testing**: `npm test` – Runs the test suite with Vitest.\n  - `npm test:ui` – Opens an interactive test UI.\n  - `npm test:coverage` – Generates code coverage reports.\n- **Build**: `npm run build` – Creates a production bundle in the `dist/` directory.\n- **Preview**: `npm run preview` – Serves the built application locally.\n\n## Deploy to GitHub Pages\n\nThis repo includes a GitHub Actions workflow that automatically builds and deploys the `dist/` folder to GitHub Pages whenever you push to the `main` branch.\n\n### One-time GitHub setup\n\n1. Push this repo to GitHub.\n2. In GitHub, go to **Settings → Pages**.\n3. Under **Build and deployment**, set **Source** to **GitHub Actions**.\n\nAfter the first successful workflow run on `main`, your site will be available at:\n\n- `https://\u003cyour-username\u003e.github.io/\u003cyour-repo\u003e/`\n\n### Repo name / base path\n\nVite needs a correct `base` path for Pages (because Pages serves the site under `/\u003crepo\u003e/`). This project currently assumes the repo name is `md-preview`.\n\nIf your repo name is different, update `vite.config.js` to match your repository name (the `/\u003crepo\u003e/` part).\n\n### Project Structure\n\n- `src/main.jsx`: Entry point for React.\n- `src/App.jsx`: Main app component, routes to MarkdownViewer.\n- `src/markdown-viewer.jsx`: Core component for note editing and preview.\n- `src/components/`: Reusable React components (Sidebar, Editor, Preview, Toolbar).\n- `src/hooks/`: Custom React hooks (useNotesStorage).\n- `src/utils/`: Utility functions (markdown rendering with marked + DOMPurify).\n- `src/styles/`: CSS modules for component styling.\n- `src/test/`: Test setup and configuration.\n- `src/**/*.test.js`: Unit test files (61 tests covering utilities and hooks).\n- `public/`: Static assets.\n\nFollow the coding guidelines in `AGENTS.md` for contributions.\n\n### Test Coverage\n\nThe project includes comprehensive unit tests:\n- ✅ 37 tests for markdown rendering (marked + DOMPurify integration)\n- ✅ 24 tests for notes storage hook (localStorage, CRUD operations, autosave)\n- 🎯 All tests passing with 100% success rate\n\nRun `npm test` to execute the test suite.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a feature branch (\\`git checkout -b feature/new-feature\\`).\n3. Make changes, ensuring \\`npm run lint\\` passes.\n4. Commit with descriptive messages.\n5. Open a pull request with a summary, screenshots if UI changes, and verification steps.\n\n## License\n\nThis project is private and not licensed for public use. Contact the maintainer for permissions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqduc%2Fmd-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqduc%2Fmd-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqduc%2Fmd-preview/lists"}