Just A Markdown Viewer - A lightweight, native macOS application for viewing and monitoring Markdown files in real-time.
JAMViewer just reads and renders markdown files... nothing more, nothing less. It automatically monitors your files for changes and updates the view in real-time, making it perfect for previewing Markdown while you write.
- Real-Time File Monitoring: Automatically updates when your Markdown file changes
- Command Line Support: Open files directly from Terminal (
JAMViewer file.md) - Drag & Drop: Drag Markdown files onto the app to view them
- Keyboard Shortcuts:
⌘O- Open file⌘+or⌘=- Increase font size⌘-- Decrease font size⌘0- Reset font size
- Beautiful Typography: Custom styled headings, code blocks, and blockquotes
- Code Highlighting: Monospace font (Menlo) with background highlighting for code blocks
- Dark Mode Support: Automatically adapts to light and dark mode
- Native macOS App: Built with SwiftUI for optimal performance
- macOS 12.0+
- Xcode 14.0+ (for building from source)
- Clone this repository
- Open
JAMViewer.xcodeprojin Xcode - Add MarkdownUI via Swift Package Manager:
- File → Add Package Dependencies...
- Enter:
https://github.com/gonzalezreal/swift-markdown-ui
- Build and run (⌘R)
There are multiple ways to open Markdown files:
- File Menu: Launch the app and use
⌘Oor File → Open File... - Command Line:
open -a JAMViewer path/to/file.md - Drag & Drop: Drag a
.mdfile onto the app icon or window - Default App: Set JAMViewer as the default app for
.mdfiles
Once a file is open, JAMViewer will:
- Display the rendered Markdown with styled typography
- Automatically refresh when the file is saved or modified
- Maintain your preferred font size across sessions
JAMViewer is built with a clean SwiftUI architecture:
- JAMViewerApp.swift: Main app entry point with file opening and command-line handling
- ContentView.swift: Main view displaying rendered Markdown
- MarkdownRenderer.swift: Custom Markdown rendering component with styled typography
- FileManagerModel.swift: Observable model managing file selection state
- FileMonitor.swift: File system monitoring using Grand Central Dispatch
- FontSizeKeyboardShortcuts.swift: Custom keyboard shortcut handling for font size
- EmptyStateView.swift: Placeholder views for various states (empty, loading, error)
The app uses a proportional typography scale based on the adjustable base font size:
- Body Text: Base font size (default: 16pt)
- H1: 2.0× base size
- H2: 1.5× base size with underline
- H3: 1.17× base size
- Code: 0.9× base size in Menlo font
- Code Blocks: Menlo font with background fill and rounded borders
- Headings: Bold/semibold weights with appropriate spacing
- Blockquotes: Blue left border accent with indentation
- Headings (H1, H2, H3)
- Paragraphs with bold and italic text
- Code blocks with syntax highlighting background
- Inline
codesnippets - Blockquotes
- Ordered and unordered lists
- Links
- Images
- Tables
- And more via MarkdownUI
- SwiftUI: Modern declarative UI framework
- MarkdownUI: Powerful Markdown rendering library
- Grand Central Dispatch: Efficient file system monitoring
- AppKit: Native macOS integration
Contributions are welcome! Feel free to:
- Report bugs or request features via Issues
- Submit pull requests with improvements
- Suggest enhancements to the viewer or styling