A modern, cross-platform Markdown editor built with Electron and TypeScript. Markit provides a clean, distraction-free writing experience with powerful features for managing and editing Markdown files.
- Dual-mode editing: Switch between raw markdown editor and live preview
- Real-time preview: Instant markdown rendering with syntax highlighting
- Smart paste: Automatic HTML-to-Markdown conversion when pasting
- State preservation: Maintains scroll position and cursor location across mode switches
- Mode indicator: Floating badge showing current edit/preview mode
- File explorer: Built-in tree view with folder navigation
- Recent files: Quick access to recently opened files and folders
- Recent Files Switcher: macOS-style modal with Cmd/Ctrl+Tab navigation
- File operations: Create, rename, delete files and directories
- Folder indicators: Visual distinction between empty and populated folders
- Horizontal scrolling: View complete long filenames
- Multi-format support: Optimized for Markdown (.md) files
- Local search: Search within current document with highlighting
- Global search: Search across all files in the current directory
- Table of Contents: Auto-generated from markdown headings with Unicode support
- Fast file scanning: Powered by fast-glob for efficient directory traversal
- Context-aware results: Shows search matches with surrounding context
- Markdown extensions: Support for emoji, code preview, and base URL handling
- Heading ID generation: Anchor links for TOC navigation in preview mode
- Export to HTML: Export styled HTML with CJK font support and print-ready formatting
- Image Drag-and-Drop: Drag images from Finder/Explorer, auto-saved to
.assets/folders - Table Editor: Insert markdown tables visually with configurable size
- Keyboard shortcuts: Comprehensive shortcuts for efficient workflow
- Autosave: Automatic saving with configurable intervals
- Performance optimization: LRU caching, content hash-based caching, and Web Workers
- Security: DOMPurify sanitization, path validation, sandboxed renderer, and IPC channel whitelisting
- Settings modal: Theme, font, and autosave customization
- Keyboard shortcuts modal: View all shortcuts in-app (Cmd/Ctrl+?)
- Modern design system: CSS variables for consistent theming
- Custom scrollbars: Styled scrollbars for better aesthetics
- Improved typography: System fonts for native feel
- Enhanced file explorer: Better spacing, hover effects, and visual feedback
- Node.js 18.x or 20.x
- npm 9.x or higher
- Clone the repository:
git clone https://github.com/JianliZh429/markit.git
cd markit- Install dependencies:
npm install- Build the project:
npm run build- Start the application:
npm startnpm start- Start the application in development modenpm run build- Build for development with source mapsnpm run build:dev- Development build with debugging enablednpm run build:prod- Production build (optimized)
npm test- Run all testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coverage report
npm run lint- Run ESLintnpm run lint:fix- Fix ESLint issues automaticallynpm run format- Format code with Prettier
npm run clean- Clean build and dist directoriesnpm run package- Create platform-specific packages (macOS Intel, macOS Apple Silicon, Linux)npm run package:mac- Build for macOS (both Intel and Apple Silicon)npm run package:mac-intel- Build for Intel Macs (x64)npm run package:mac-apple- Build for Apple Silicon (arm64)npm run package:linux- Build for Linux (x64)npm run dmg- Create macOS DMG installers (Intel + Apple Silicon)npm run deb- Create Debian package for Linux distributionnpm run installer- Build complete installer suite for all platforms
Markit follows Electron's multi-process architecture:
- Main Process: Node.js environment handling system APIs, file operations, and application lifecycle
- Renderer Process: Chromium browser environment for the UI, sandboxed for security
- Preload Script: Security bridge between main and renderer processes
- State Management: Centralized state with event-driven updates and persistence
- Service Layer: Abstracted file operations and markdown processing
- Module System: Separated concerns for editor, preview, file tree, and search
- Security Layer: Path validation, IPC channel whitelisting, and content sanitization
- Performance Layer: LRU caching, debouncing, and optimized file scanning
- Configuration System: Persistent user preferences and application settings
markit/
├── markit/ # Source code
│ ├── main/ # Main process (Node.js environment)
│ │ ├── app.ts # Application lifecycle and IPC handlers
│ │ ├── menu.ts # Application menu and context menus
│ │ ├── preload.ts # Security bridge between processes
│ │ ├── security.ts # Path validation and security utilities
│ │ ├── recent-files.ts # Recent files management
│ │ ├── shortcuts.ts # Global keyboard shortcuts
│ │ ├── config.ts # Configuration management
│ │ └── utils/ # Logging and utility functions
│ ├── renderer/ # Renderer process (Browser environment)
│ │ ├── renderer.ts # Main renderer orchestrator
│ │ ├── state.ts # Centralized state management
│ │ ├── search.ts # Search functionality
│ │ ├── services/ # Business logic services
│ │ │ ├── fileService.ts # File system operations
│ │ │ └── markdownService.ts # Markdown parsing and rendering
│ │ ├── modules/ # UI component modules
│ │ │ ├── editor.ts # Markdown editor functionality
│ │ │ ├── preview.ts # Preview pane with live rendering
│ │ │ └── fileTree.ts # File explorer tree view
│ │ └── utils/ # Performance utilities (caching, debouncing)
│ ├── assets/ # Static resources
│ │ ├── styles.css # Application styling
│ │ └── images/ # Icons and application assets
│ └── index.html # Main application HTML
├── tests/ # Test suites
│ ├── unit/ # Unit tests for individual modules
│ └── integration/ # Integration tests for IPC and workflows
├── types/ # TypeScript type definitions
├── .github/ # GitHub Actions CI/CD workflows
└── dist/ # Compiled output (generated)
Markit v0.1.0 is the latest stable release with core features complete. For detailed information about completed features, in-progress work, and future plans, see the Development Plan.
- Multi-platform testing: Ubuntu and macOS with Node.js 18.x and 20.x
- Automated builds: TypeScript compilation and packaging verification
- Code quality: ESLint, Prettier, and test coverage reporting
- Security audits: Dependency vulnerability scanning
- Package verification: Cross-platform installer testing (Intel + Apple Silicon)
See ARCHITECTURE.md for detailed technical architecture and system design. See docs/DEVELOPMENT_PLAN.md for the complete development roadmap and feature status.
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Development setup
- Code standards
- Testing requirements
- Pull request process
- User Manual - Complete guide to using Markit
- Changelog - Version history and release notes
- Keyboard Shortcuts - Quick reference for all shortcuts
- API Documentation - Technical API reference
- Architecture - System architecture and design patterns
- Contributing Guide - Development guidelines
- Development Plan - Roadmap and feature status
Markit implements multiple layers of security to protect users from malicious content:
- DOMPurify Integration: All HTML pasted into the editor is sanitized using DOMPurify before conversion to Markdown
- XSS Prevention: Script tags, event handlers, and dangerous protocols are automatically stripped
- Safe HTML Subset: Only safe HTML elements and attributes are allowed during HTML-to-Markdown conversion
- Sandboxed Renderer: The renderer process runs in a sandboxed environment with limited system access
- Context Isolation: Preload script provides a secure bridge between renderer and main processes
- IPC Channel Whitelisting: Only explicitly allowed IPC channels can be invoked from the renderer
- Path Validation: All file system operations validate paths to prevent directory traversal attacks
- Keep Dependencies Updated: Regularly run
npm auditand update dependencies - Verify Pasted Content: While HTML is sanitized, always review pasted content from untrusted sources
- Use Official Builds: Download Markit only from official releases or build from source
- Report Security Issues: Please report security vulnerabilities responsibly via GitHub Issues
- Run
npm auditto check for known vulnerabilities in dependencies - CI pipeline includes automated security auditing on every push
- Dependency tree verification is performed in CI/CD
See Keyboard Shortcuts for the complete list.
Cmd/Ctrl + N- Create new fileCmd/Ctrl + O- Open file dialogCmd/Ctrl + D- Open folder dialogCmd/Ctrl + S- Save current fileCmd/Ctrl + A- Select all content
Cmd/Ctrl + /- Toggle between edit and preview modeCmd/Ctrl + B- Toggle file explorer panelCmd/Ctrl + Shift + T- Toggle table of contents panelCmd/Ctrl + F- Local search within current documentCmd/Ctrl + Shift + F- Global search across all filesF3orCmd/Ctrl + G- Find next matchShift + F3orCmd/Ctrl + Shift + G- Find previous match
- Auto-save with configurable intervals
- Context menu with file operations
- Scroll synchronization between editor and preview
- Press
Cmd/Ctrl + ?or go to Help → Keyboard Shortcuts to view all shortcuts in the app
- Electron 38.2.2 - Cross-platform desktop framework
- TypeScript 5.9.3 - Type-safe JavaScript development
- Node.js - Backend runtime for main process
- marked 16.4.0 - Fast markdown parser and compiler
- marked-emoji 2.0.1 - Emoji support in markdown
- marked-highlight 2.2.2 - Syntax highlighting for code blocks
- marked-code-preview 1.3.7 - Enhanced code block rendering
- marked-base-url 1.1.7 - Base URL resolution for relative links
- DOMPurify 3.3.3 - HTML sanitization for XSS prevention
- Jest 30.2.0 - Testing framework with TypeScript support
- ESLint 9.37.0 - Code linting and style enforcement
- Prettier 3.6.2 - Code formatting
- esbuild 0.25.10 - Fast bundler for renderer process
- ts-jest 29.4.4 - TypeScript support for Jest
- fast-glob 3.3.3 - High-performance file system scanning
- fs-extra 11.3.2 - Enhanced file system operations
- @electron/packager 18.4.4 - Application packaging
- electron-installer-dmg 5.0.1 - macOS installer creation
- electron-installer-debian 3.2.0 - Linux package creation
MIT License - see LICENSE file for details.
Jianli Zhang
Version: 0.3.0 Status: Stable Release Platforms: macOS (Intel + Apple Silicon), Linux Release Date: March 21, 2026