Menu

Tree [e65156] master /
 History

HTTPS access


File Date Author Commit
 .vscode 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 images 2025-11-30 Phisict Phisict [ebd723] Add MOre UI
 src 2025-12-02 Phisict Phisict [e65156] feat: adjust padding for preview container to e...
 static 2025-11-30 Phisict Phisict [a697f7] Add logo, manifest, robots.txt, and sitemap for...
 .gitignore 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 .npmrc 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 .prettierignore 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 .prettierrc 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 LICENSE 2025-11-30 Fathan Fathan [15dc5f] Create LICENSE
 README.md 2025-12-01 Phisict Phisict [e54d78] feat: add copy code button and fine-grained upd...
 eslint.config.js 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 package.json 2025-12-01 Phisict Phisict [5514df] feat: add static adapter and improve service wo...
 pnpm-lock.yaml 2025-12-01 Phisict Phisict [5514df] feat: add static adapter and improve service wo...
 svelte.config.js 2025-11-30 Phisict Phisict [f45497] feat: implement service worker for offline supp...
 tsconfig.json 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 vite.config.ts 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...
 wrangler.jsonc 2025-11-30 Phisict Phisict [2f9b77] Initialize web application via create-cloudflar...

Read Me

SvelteMark Logo # SvelteMark 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. [![Live Demo](https://img.shields.io/badge/Live%20Demo-sm.fana.my.id-58a6ff?style=for-the-badge)](https://sm.fana.my.id) [![License](https://img.shields.io/badge/License-MIT-3fb950?style=for-the-badge)](LICENSE) [![Svelte](https://img.shields.io/badge/Svelte-5-ff3e00?style=for-the-badge&logo=svelte&logoColor=white)](https://svelte.dev/)

SvelteMark Screenshot

Features

Privacy & Security

  • 100% Local Storage - All data stored in your browser's IndexedDB
  • No Server Communication - Zero network requests for your notes
  • No Account Required - Start writing immediately, no sign-up
  • Export Your Data - Full data portability with JSON backup

Offline Support

  • Full PWA Support - Install as a native app on desktop and mobile
  • Works Offline - Continue writing even without internet connection
  • Service Worker Caching - All app assets cached for instant loading
  • Auto-Sync Updates - Automatically updates when new versions are available

Core Editor

  • CodeMirror 6 Editor - Powerful text editing with syntax highlighting
  • Live Preview - Real-time markdown rendering with GitHub styling
  • Fine-Grained Reactivity - Block-based rendering that only updates changed sections
  • Scroll Sync - Proportional scroll synchronization between editor and preview
  • Auto-save - Automatic saving with debounced updates

Markdown Support

  • GitHub Flavored Markdown - Tables, task lists, strikethrough, and more
  • Math Equations - LaTeX math rendering with KaTeX
  • Mermaid Diagrams - Flowcharts, sequence diagrams, pie charts
  • Syntax Highlighting - Code block highlighting for 100+ languages
  • Copy Code Button - One-click copy for code blocks

File Management

  • File Explorer - Organize notes in folders with tree view
  • Drag & Drop - Reorder files and folders by dragging
  • Root-Level Files - Create files outside folders at root level
  • Rename & Delete - Right-click context menu for file operations
  • Nested Folders - Support for hierarchical folder structure

UI/UX

  • GitHub Dark Theme - Beautiful dark theme matching GitHub's design
  • Resizable Panels - Drag to resize sidebar and editor/preview split
  • Auto-hide UI - Distraction-free writing mode
  • View-only Mode - Focus on reading without the editor

Tools

  • Print Support - Print documents with light theme (Ctrl+P)
  • Export/Import - Backup and restore all your notes as JSON
  • Help - Built-in welcome guide with markdown examples

Screenshots

Main Editor View

Editor View

Preview Mode

Preview Mode

Preview Mode w/ TOC

Preview Mode with TOC

Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/MasFana/sveltemark.git
cd sveltemark

# Install dependencies
pnpm install

# Start development server
pnpm dev

Open http://localhost:5173 in your browser.

Building for Production

# Build the application
pnpm build

# Preview the production build
pnpm preview

Keyboard Shortcuts

Shortcut Action
Ctrl+S Save now
Ctrl+B Bold
Ctrl+I Italic
Ctrl+P Print

Tech Stack

Project Structure

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

Data Storage

SvelteMark uses IndexedDB via Dexie.js for local-first data storage. All your notes are stored in your browser and never leave your device.

Database Schema

  • folders: id, name, parentId, isOpen
  • files: id, folderId (nullable), title, content, createdAt, updatedAt

Note: folderId can be null for root-level files (files not inside any folder).

Export/Import

You can export all your data as a JSON file for backup:

  1. Click the (More) menu in the toolbar
  2. Select Export Backup
  3. Save the JSON file

To restore:

  1. Click Import Backup
  2. Select your backup JSON file

Offline Mode

SvelteMark works fully offline as a Progressive Web App (PWA).

How It Works

  • 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

Installing as PWA

  1. Visit the app in Chrome, Edge, or Safari
  2. Click the install icon in the address bar (or "Add to Home Screen" on mobile)
  3. Launch from your desktop or home screen
  4. Works offline - no internet required!

Notes

  • 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

Theming

The application uses a GitHub-inspired dark theme with the following color palette:

Element Color
Background #0d1117
Surface #161b22
Border #30363d
Text #c9d1d9
Muted #8b949e
Accent #58a6ff
Success #3fb950
Warning #d29922
Danger #da3633

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made with Svelte 5 | Open Source | Privacy First