A privacy-first, open-source, local-only markdown editor built with Svelte 5.
Your notes never leave your device. No accounts. No tracking. No cloud.
- Local-First Architecture: 100% of data lives in your browser's IndexedDB via Dexie.js.
- Privacy Focused: Zero telemetry, no server uploads, no account required.
- Offline Ready: Full PWA support. Install it on your device and write without internet.
- Live Preview: Real-time rendering with CodeMirror 6.
- Smart Scroll Sync: Bi-directional scrolling matches your editor and preview perfectly.
- Rich Content:
- Diagrams: Native Mermaid.js support (Flowcharts, Sequence, Gantt).
- Math: LaTeX equations via KaTeX.
- GFM: Full GitHub Flavored Markdown support (Tables, Task lists, etc).
- File System: Hierarchical file tree with drag-and-drop organization.
- Backup & Restore: One-click JSON export of your entire database.
- Distraction Free: Auto-hiding UI and "View Only" modes.
- Vim Mode: (Coming soon/Supported via CodeMirror).
- Print Ready: CSS optimized for beautiful PDF exports (
Ctrl+P).
Split-view editor with live markdown preview, file explorer on the left
Beautiful rendered markdown with GitHub-style formatting
Hierarchical file and folder organization with drag-and-drop support
Comprehensive formatting options via toolbar and right-click context menu
Built-in help system with all keyboard shortcuts and markdown examples
# Clone the repository
git clone https://github.com/MasFana/sveltemark.git
cd sveltemark
# Install dependencies
pnpm install
# Start development server
pnpm devOpen http://localhost:5173 in your browser.
# Build the application
pnpm build
# Preview the production build
pnpm preview| Shortcut | Action |
|---|---|
Ctrl+B |
Bold text |
Ctrl+I |
Italic text |
| Ctrl+` | `Inline code` |
Ctrl+~ |
|
Ctrl+Shift+. |
Numbered list |
Ctrl+. |
Bullet list |
Ctrl+Q |
Block quote |
| Shortcut | Action |
|---|---|
Ctrl+H |
Show keyboard shortcuts panel |
Ctrl+F |
Find and replace |
Ctrl+P |
Print document |
Ctrl+S |
Save now |
Ctrl+/ |
Toggle comment |
Tab |
Indent line |
Shift+Tab |
Outdent line |
| Shortcut | Action |
|---|---|
Ctrl+0 |
Reset zoom |
F11 |
Enter fullscreen |
| Shortcut | Action |
|---|---|
Ctrl+A |
Select all |
Ctrl+D |
Select next occurrence |
Ctrl+Shift+L |
Select all occurrences |
- Framework: Svelte 5 with Runes
- Build Tool: Vite
- Editor: CodeMirror 6
- Database: Dexie.js (IndexedDB wrapper)
- Markdown Processing:
- unified ecosystem
- remark-gfm - GitHub Flavored Markdown
- remark-math + rehype-katex - Math equations
- rehype-highlight - Code syntax highlighting
- Diagrams: Mermaid
- Styling: github-markdown-css
- Deployment: Cloudflare Pages (optional)
- Offline: Service Worker with cache-first strategy for PWA support
fanadown/
βββ src/
β βββ lib/
β β βββ components/
β β β βββ Editor.svelte # CodeMirror editor component
β β β βββ Preview.svelte # Markdown preview component
β β β βββ Sidebar.svelte # File explorer sidebar
β β β βββ FileTree.svelte # Recursive file tree
β β β βββ Toolbar.svelte # Formatting toolbar
β β βββ appState.svelte.ts # Global reactive state
β β βββ db.ts # Dexie database operations
β β βββ markdown.ts # Markdown processing pipeline
β β βββ index.ts # Library exports
β βββ service-worker.ts # PWA offline caching
β βββ routes/
β βββ +layout.svelte # App layout
β βββ +page.svelte # Main page
βββ static/ # Static assets
βββ package.json
βββ svelte.config.js
βββ vite.config.ts
βββ tsconfig.json
SvelteMark uses IndexedDB via Dexie.js for local-first data storage. All your notes are stored in your browser and never leave your device.
- folders:
id, name, parentId, isOpen - files:
id, folderId (nullable), title, content, createdAt, updatedAt
Note:
folderIdcan benullfor root-level files (files not inside any folder).
You can export all your data as a JSON file for backup:
- Click the β― (More) menu in the toolbar
- Select Export Backup
- Save the JSON file
To restore:
- Click Import Backup
- Select your backup JSON file
SvelteMark works fully offline as a Progressive Web App (PWA).
- Service Worker: Caches all app assets on first visit
- Cache-First Strategy: Assets are served from cache instantly
- Background Updates: New versions are fetched automatically when online
- Data Persistence: Your notes are stored locally in IndexedDB
- Visit the app in Chrome, Edge, or Safari
- Click the install icon in the address bar (or "Add to Home Screen" on mobile)
- Launch from your desktop or home screen
- Works offline - no internet required!
- First visit requires internet to download the app
- After installation, the app works completely offline
- Updates are applied automatically when you're back online
- All data stays local - nothing is sent to servers even when online
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Svelte - The amazing reactive framework
- CodeMirror - The versatile code editor
- GitHub - Design inspiration for the dark theme
- ByteMD / StackEdit - Scroll sync inspiration
Made with Svelte 5 | Open Source | Privacy First