A modern, feature-rich desktop Markdown editor built with Electron, React, and TypeScript
Wrangle is a powerful desktop Markdown editor that combines the Monaco Editor with live preview, syntax highlighting, mathematical formula rendering, and diagram support. Whether you're writing documentation, taking notes, or creating content, Wrangle provides a seamless editing experience with professional-grade features.
Install globally via npm:
npm install -g wrangleThen launch from anywhere:
wrangleOpen a file directly:
wrangle path/to/file.md- Monaco Editor - The same powerful code editor that powers VS Code
- Live Preview - Real-time Markdown rendering with scroll synchronization
- Math Support - Beautiful mathematical formulas with KaTeX
- Diagrams - Create flowcharts, sequence diagrams, and more with Mermaid
- Multi-tab Interface - Work with multiple files simultaneously
- Smart Image Handling - Drag-and-drop images with automatic asset management
- 14 Built-in Themes - Includes Dracula, Nord, Tokyo Night, Catppuccin, and more, plus custom theme creation
- Multi-Workspace Support - Manage multiple projects with per-workspace session persistence
- WYSIWYG Editing - Select text in the preview pane to apply formatting directly
- Monaco Editor Integration - Professional code editing experience with IntelliSense-like features
- Multi-tab File Management - Open and switch between multiple Markdown files
- Auto-save Functionality - Never lose your work with automatic draft recovery
- Keyboard Shortcuts - Efficient text editing with comprehensive shortcuts
- Syntax Highlighting - Code blocks with syntax highlighting via highlight.js
- Real-time Rendering - See changes instantly as you type
- GitHub Flavored Markdown (GFM) - Full support for GFM extensions
- Scroll Synchronization - Editor and preview scroll together
- Front Matter Support - YAML front matter parsing with gray-matter
- Inline Math - Use
$...$syntax for inline formulas - Block Math - Use
$$...$$syntax for display formulas - KaTeX Integration - Fast and beautiful mathematical typesetting
- Mermaid Diagrams - Create diagrams directly in Markdown
- Multiple Diagram Types - Flowcharts, sequence diagrams, class diagrams, state diagrams, and more
- Live Rendering - Diagrams render in real-time in the preview pane
- Drag-and-Drop - Simply drag images into the editor
- Automatic Organization - Images saved to
assets/folders relative to your Markdown files - Duplicate Handling - Intelligent filename collision resolution
- Copy & Paste - Paste images directly from clipboard
- Editor-Only Mode - Focus on writing (Ctrl+1)
- Split View Mode - See editor and preview side-by-side (Ctrl+2)
- Preview-Only Mode - Focus on the rendered output (Ctrl+3)
- Resizable Panes - Adjust the split ratio to your preference
- Headings - H1 through H6 heading styles
- Text Formatting - Bold, Italic, Strikethrough, Inline Code
- Links & Images - Quick insertion helpers
- Code Blocks - Fenced code blocks with language support
- Lists - Bullet lists, numbered lists, and task lists
- Blockquotes - Quote formatting
- Tables - Markdown table insertion
- Horizontal Rules - Visual dividers
- Multiple Formats - Support for .md, .markdown, .mdown, .mkd, .mdwn, .txt
- Save & Save As - Standard file operations with shortcuts
- Draft Recovery - Automatic recovery of unsaved work
- Temp File Management - Intelligent temporary file cleanup
- 14 Built-in Themes - Choose from a curated selection of popular themes:
- Light: Lightish, Solarized Light
- Dark: Dark, Balanced Grey, Ayu Mirage, Catppuccin Mocha, Dracula, Material Palenight, Monokai Pro, Night Owl, Nord, One Dark Pro, Solarized Dark, Tokyo Night
- Custom Theme Creation - Create your own themes with the built-in CSS editor
- Theme Persistence - Your preference is remembered
- Multi-Folder Projects - Open folders as workspaces for project-based organization
- File Tree Navigation - Browse and open files directly from the workspace sidebar
- Color-Coded Indicators - Each workspace has a customizable color for easy identification
- Session Persistence - Open tabs, scroll positions, and view modes saved per workspace
- Multi-Pane Editing - View multiple workspaces side-by-side
- Preview Selection Formatting - Select text in the preview pane and apply formatting via toolbar or shortcuts
- Active Format Detection - Toolbar buttons highlight when cursor is within formatted text
- Toggle Behavior - Click a format button to apply; click again to remove
- Node.js (v18 or higher recommended)
- npm or yarn package manager
- Clone the repository:
git clone https://github.com/yourusername/wrangle.git
cd wrangle- Install dependencies:
npm install- Run the application:
npm startDevelopment mode:
npm run build
npm start| Action | Shortcut |
|---|---|
| File Operations | |
| Open File | Ctrl+O |
| Save File | Ctrl+S |
| Save As | Ctrl+Shift+S |
| Exit | Ctrl+Q |
| View Modes | |
| Editor Only | Ctrl+1 |
| Split View | Ctrl+2 |
| Preview Only | Ctrl+3 |
| Text Formatting | |
| Bold | Ctrl+B |
| Italic | Ctrl+I |
| Inline Code | Ctrl+` |
| Insert Link | Ctrl+K |
| Editor | |
| Undo | Ctrl+Z |
| Redo | Ctrl+Y |
| Cut | Ctrl+X |
| Copy | Ctrl+C |
| Paste | Ctrl+V |
| Select All | Ctrl+A |
- Drag and Drop: Drag an image file from your file explorer directly into the editor
- Automatic Organization: The image is automatically copied to an
assets/folder next to your Markdown file - Relative Paths: Markdown image syntax is inserted with the correct relative path
- Preview: The image appears in the preview pane immediately
- Editor-Only: Maximum space for writing, preview hidden
- Split View: Default mode with resizable editor and preview panes
- Preview-Only: See the fully rendered document without the editor
| Command | Description |
|---|---|
npm run dev |
Start development mode with hot reload |
npm run build |
Build TypeScript and bundle with Vite |
npm run preview |
Run the built application |
npm start |
Alias for npm run preview |
wrangle/
├── src/
│ ├── main/ # Main process (Node.js)
│ │ ├── index.ts # Application entry point
│ │ ├── ipc/ # IPC handlers
│ │ │ ├── index.ts # Handler registration
│ │ │ ├── file-handler.ts # File operations
│ │ │ └── window-handler.ts
│ │ ├── menu/
│ │ │ └── menu-template.ts # Application menu
│ │ └── utils/
│ │ └── temp-dir-manager.ts
│ ├── preload/ # Preload script (bridge)
│ │ ├── index.ts # IPC API exposure
│ │ └── electron.d.ts # TypeScript definitions
│ └── renderer/ # Renderer process (React)
│ └── src/
│ ├── App.tsx # Root component
│ ├── main.tsx # React entry point
│ ├── components/
│ │ ├── Editor/ # Monaco editor wrapper
│ │ ├── Preview/ # Markdown preview
│ │ ├── Tabs/ # Tab management UI
│ │ ├── Layout/ # Split layout
│ │ ├── Workspace/ # Workspace sidebar and file tree
│ │ └── UI/ # Toolbar components
│ ├── hooks/ # Custom React hooks
│ ├── store/ # Redux store
│ │ ├── index.ts
│ │ ├── tabsSlice.ts
│ │ ├── layoutSlice.ts
│ │ ├── workspacesSlice.ts
│ │ └── settingsSlice.ts
│ ├── utils/
│ │ ├── markdown-commands.ts
│ │ └── markdown-renderer.ts
│ └── styles/
├── electron.vite.config.ts # Build configuration
├── package.json
├── tsconfig.json
└── CLAUDE.md # Development guide
Wrangle follows the standard Electron multi-process architecture:
Main Process (src/main/)
- Manages application lifecycle and native OS integration
- Creates and controls browser windows
- Handles file system operations (open, save, image copying)
- Manages native application menu
- Registers IPC handlers for renderer communication
Renderer Process (src/renderer/)
- React application running in a Chromium browser window
- Monaco Editor integration for text editing
- Markdown preview rendering pipeline
- Redux state management for tabs, layout, and theme
- UI components and user interactions
Preload Script (src/preload/)
- Security bridge between main and renderer processes
- Exposes type-safe
window.electronAPI to renderer - Prevents direct Node.js access from renderer for security
- Type definitions in electron.d.ts
All communication between main and renderer uses IPC channels:
File Operations (main → renderer):
window.electron.file.open()- Opens file picker, returns file datawindow.electron.file.save(path, content)- Saves to existing pathwindow.electron.file.saveAs(content)- Shows save dialog, returns new pathwindow.electron.file.copyImage(sourcePath, markdownPath)- Copies image to assets folder
Window Controls (renderer → main):
window.electron.window.minimize/maximize/close()- Window management
Menu Commands (main → renderer):
window.electron.onMenuCommand(callback)- Receives menu actions
Redux Toolkit manages application state with four slices:
{
tabs: {
tabs: Tab[], // Array of open file tabs
activeTabId: string // Currently focused tab
},
layout: {
viewMode: 'split' | 'editor' | 'preview',
splitRatio: number, // Pane split ratio (0.2-0.8)
previewSync: boolean // Scroll sync enabled
},
workspaces: {
workspaces: WorkspaceState[], // Open workspaces
activeWorkspaceId: string // Currently active workspace
},
settings: {
theme: {
current: string, // Current theme name
customThemes: Record // User-created themes
}
}
}- Parse YAML front matter with
gray-matter - Process Markdown with
marked+ extensions (marked-highlight,marked-gfm-heading-id) - Apply syntax highlighting via
highlight.js - Render math expressions via
KaTeX(inline:$...$, block:$$...$$) - Render diagrams via
Mermaid(code blocks withmermaidlanguage) - Display sanitized HTML in preview pane
- Build Tool: electron-vite (combines Vite for renderer, esbuild for main/preload)
- Config File: electron.vite.config.ts
- Path Alias:
@/→src/renderer/src(renderer only) - TypeScript: Strict mode enabled, ES2020 target
- Output Directory:
out/(main, preload, renderer subdirectories)
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For development guidance and architecture details, see CLAUDE.md.
- Electron 28.0.0 - Cross-platform desktop application framework
- React 18.2.0 - UI component library
- TypeScript 5.3.3 - Type-safe JavaScript
- Monaco Editor 0.45.0 - The code editor that powers VS Code
- @monaco-editor/react 4.6.0 - React wrapper for Monaco
- Allotment 1.20.0 - Resizable split pane component
- react-hotkeys-hook 4.4.1 - Keyboard shortcut hooks
- Marked 12.0.0 - Markdown parser and compiler
- marked-highlight 2.1.0 - Code block syntax highlighting
- marked-gfm-heading-id 3.1.3 - GitHub-style heading IDs
- highlight.js 11.11.1 - Syntax highlighting for code blocks
- gray-matter 4.0.3 - Front matter parsing
- @reduxjs/toolkit 2.0.1 - Redux state management
- react-redux 9.0.4 - React bindings for Redux
- electron-vite 2.0.0 - Lightning-fast Electron build tool
- Vite 5.0.10 - Next-generation frontend tooling
- electron-builder 24.9.1 - Application packaging and distribution
- electron-updater 6.1.7 - Auto-update functionality
This project is licensed under the MIT License - see the package.json for details.
- Built with Electron, React, and TypeScript
- Editor powered by Monaco Editor
- Markdown rendering by Marked
- Math rendering by KaTeX
- Diagrams by Mermaid
Made with care for Markdown enthusiasts everywhere.