Skip to content

aleks/markdown-editor

Repository files navigation

Markdown Editor

An experimental, minimal markdown editor and previewer built with Preact and packaged as a native desktop app with Tauri. This is a personal project — feel free to download pre-built binaries from the releases page or clone the repo and build it yourself.

Everything runs locally in the browser/webview. No server, no login, no data leaves your machine.

Preview mode Editor mode

Features

  • Full markdown rendering — headings, lists, tables, blockquotes, code blocks, images, links, horizontal rules
  • Syntax highlighting — code blocks are highlighted via highlight.js
  • Mermaid diagrams — fenced mermaid code blocks are rendered as diagrams
  • Vim mode — toggle-able vim keybindings powered by CodeMirror 6 and @replit/codemirror-vim
  • Light and dark theme — follows system preference by default, with a manual toggle that persists
  • Auto-save — editor content is saved to localStorage automatically
  • Keyboard shortcutsCmd/Ctrl+P to toggle preview, Cmd/Ctrl+K to toggle vim mode

Installation

You can use the editor online at markdowneditor.work — no installation required.

Pre-built binaries for macOS, Linux, and Windows are available on the releases page.

macOS

The app is not code-signed, so macOS will flag it as "damaged" when first opened. After mounting the .dmg and dragging the app to Applications, run:

xattr -cr "/Applications/Markdown Editor.app"

Alternatively, clone this repo and build from source (see Building below).

Tech Stack

  • Frontend: Preact, CodeMirror 6, marked, highlight.js, mermaid
  • Bundler: Vite
  • Desktop: Tauri 2
  • Tests: Vitest + @testing-library/preact

Prerequisites

  • Node.js (LTS recommended)
  • Rust (stable toolchain) — required for Tauri builds
  • On Linux: libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

Development

# Install dependencies
npm install

# Run in browser (frontend only)
npm run dev

# Run as desktop app (Tauri dev mode with hot reload)
npm run tauri:dev

The browser dev server runs at http://localhost:5173.

Testing

# Run tests once
npm test

# Run tests in watch mode
npm run test:watch

Building

# Build frontend only
npm run build

# Build desktop app (macOS .app/.dmg, Linux .deb/.AppImage, Windows .msi/.exe)
npm run tauri:build

Build output is in src-tauri/target/release/bundle/.

Releasing

Releases are automated via GitHub Actions. When you push a version tag, the CI runs tests and then builds native installers for macOS (ARM + Intel), Linux, and Windows.

# 1. Update the version in src-tauri/tauri.conf.json
# 2. Commit the change
# 3. Tag and push
git tag v0.1.0
git push origin v0.1.0

This creates a draft release on GitHub with all platform artifacts attached. Review it and publish when ready.

Project Structure

src/
  index.jsx          # Entry point
  App.jsx            # Main app component (tabs, state, shortcuts)
  Editor.jsx         # CodeMirror editor with vim mode
  Preview.jsx        # Markdown renderer with mermaid support
  style.css          # All styles (light/dark theme via CSS variables)
  test/              # Test files
src-tauri/           # Tauri backend (Rust)
.github/workflows/   # CI/CD

About

A simple tauri-based markdown editor.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors