A native, blazing-fast macOS Markdown editor built with SwiftUI and NSTextView. Designed for developers who appreciate clean code, native performance, and modern macOS architecture.
- Extreme Performance: Direct NSTextView integration via NSViewRepresentable for maximum editing performance
- Native Document Architecture: DocumentGroup with FileDocument protocol for native document handling
- Split View Layout: Editor on left, preview on right with draggable divider
- Manual Preview Toggle: No live preview overhead - toggle when needed for performance
- Large File Support: Handles files up to 10MB effortlessly with native text engine
- Zero Dependencies: Pure Apple frameworks (SwiftUI, AppKit, Foundation)
- File Associations: Native support for .md, .markdown, .mdown extensions
- Dark Mode: Automatic system appearance support
# Clone the repository
git clone https://github.com/duhman/markdownview.git
cd markdownview
# Build the app
./build_app.sh
# Or build and install in one command
./build_app.sh release --install
# Launch MarkdownView
open MarkdownView.app- macOS: 15.0+ (Sequoia)
- Swift: 6.1+
- Xcode: 16.0+ (Command Line Tools)
./build_app.shThis creates MarkdownView.app in the project directory, ready to use.
./build_app.sh release --installThis builds a release version and copies it to /Applications/.
# Development build
swift build
# Release build
swift build -c release
# Run directly (for testing)
swift run- Right-click any Markdown file (.md, .markdown, .mdown)
- Select Get Info (⌘+I)
- Under Open with:, select MarkdownView
- Click Change All... to apply to all Markdown files
# Install duti if not already installed
brew install duti
# Set MarkdownView as default for all Markdown files
duti -s com.bigmac.markdownview net.daringfireball.markdown all- Open System Settings
- Navigate to Desktop & Dock
- Scroll to Default web browser (macOS uses this for document handlers too)
- Select MarkdownView
| Component | Technology | Rationale |
|---|---|---|
| Build System | Swift Package Manager | No Xcode project, CI/CD friendly, reproducible builds |
| UI Framework | SwiftUI + DocumentGroup | Native document-based architecture, modern declarative UI |
| Text Engine | NSTextView via NSViewRepresentable | Maximum performance, handles large files effortlessly |
| Preview Engine | AttributedString with Markdown | Native SwiftUI rendering, no web views |
| Document Model | FileDocument | SwiftUI's native document protocol, automatic save/open |
| Layout | HSplitView | Native macOS split view with draggable divider |
markdownview/
├── Package.swift # Swift Package Manager manifest
├── build_app.sh # App bundling & installation script
├── README.md # This file
├── .gitignore # Git ignore rules
├── Sources/
│ ├── MarkdownViewApp/
│ │ ├── MarkdownViewApp.swift # @main App entry point
│ │ └── MarkdownDocument.swift # FileDocument implementation
│ └── Views/
│ ├── ContentView.swift # Main split view interface
│ ├── MarkdownEditorView.swift # NSTextView NSViewRepresentable bridge
│ └── MarkdownPreviewView.swift # AttributedString markdown preview
└── MarkdownView.app # Built app bundle
| Shortcut | Action |
|---|---|
⌘+O |
Open Markdown file |
⌘+S |
Save document |
⌘+W |
Close window |
⌘+Q |
Quit app |
⌘+N |
New document |
| Toolbar Eye Icon | Toggle preview pane |
# Build and install to Applications
./build_app.sh release --install
# Or manually copy
cp -R MarkdownView.app /Applications/
# Or create symlink
ln -s $(pwd)/MarkdownView.app /Applications/MarkdownView.appThe built MarkdownView.app is self-contained and can be:
- Copied to other Macs running macOS 15+
- Shared via AirDrop, Dropbox, etc.
- Installed by simply dragging to
/Applications
Note: Since the app is ad-hoc signed, users may need to:
- Right-click the app and select Open (first launch only)
- Or run:
xattr -cr MarkdownView.appto remove quarantine
# Remove quarantine attribute
xattr -cr MarkdownView.app
# Or allow in System Settings > Privacy & Security- Check System Settings > Privacy & Security > Files and Folders
- Ensure MarkdownView has access to the folder containing your files
- Try opening via File > Open menu instead of double-click
# Clean build
swift package clean
rm -rf .build/
# Rebuild
./build_app.shMIT License - See LICENSE file for details.
This is a personal project by @duhman.
- Built with Apple's AppKit and SwiftUI frameworks
- Uses native NSTextView for extreme editing performance
- Inspired by the macOS document-based app paradigm
Made with ❤️ for macOS — Fast, native, no Electron, no bloat.