Skip to content

A completely vibe-coded Markdown Editor for Mac, inspired by a tutorial from Stewart Lynch with features suggested by the MacDown 3000 project.

License

Notifications You must be signed in to change notification settings

brainvat/markdown-editor

Repository files navigation

Mac MD

Mac MD Logo

A modern Markdown editor for macOS, iOS, and iPadOS built with SwiftUI and SwiftData.

Platform Swift SwiftUI License

✨ Features

Core Functionality

  • πŸ“ Live Markdown Preview - Real-time rendering with GitHub Flavored Markdown support
  • 🎨 Three-Column Layout - Sidebar, document list, and editor with adjustable preview
  • πŸ“± Universal App - Native experience on Mac, iPad, and iPhone
  • πŸŒ“ Dark Mode - Beautiful styling that adapts to system appearance
  • ☁️ iCloud Sync - Available with Mac MD Premium subscription

Document Organization

  • πŸ“‚ Projects - Group related documents together with icons and colors
  • 🏷️ Tags - Flexible many-to-many tagging system with colored badges
  • ⭐ Favorites - Quick access to important documents
  • πŸ• Recents - Smart collection of recently accessed documents
  • πŸ“¦ Archived - Hide completed documents without deleting

Markdown Support

  • βœ… CommonMark - Full standard Markdown support via swift-markdown
  • βœ… GitHub Flavored Markdown - Tables, task lists, strikethrough, and more

Export & Sharing

  • πŸ“„ PDF Export - Native PDF generation (Mac βœ…, iOS βœ…)
  • 🌐 HTML Export - Standalone HTML files with embedded CSS (Mac βœ…, iOS ❌)
  • πŸ“ Markdown Export - Export as .md files (Mac βœ…, iOS ❌)
  • πŸ“Š Document Stats - Word count, character count, last modified

Note: iOS HTML and Markdown exports are blocked by a confirmed SwiftUI framework bug where .fileExporter() silently fails for certain FileDocument types.

Internationalization

  • 🌍 38 Languages - Full localization across all platforms

πŸš€ Getting Started

Requirements

  • macOS 15.0+ (Sequoia)
  • iOS 18.0+
  • iPadOS 18.0+
  • Xcode 16.0+
  • Swift 6.0+

Installation

  1. Clone the repository:
git clone git@github.com:brainvat/markdown-editor.git
cd markdown-editor
  1. Open in Xcode:
open "Markdown Editor.xcodeproj"
  1. Select your target platform (Mac, iPhone, or iPad)

  2. Build and run (⌘R)

πŸ—οΈ Architecture

Mac MD follows modern Swift and SwiftUI best practices:

Data Layer

  • SwiftData for local persistence with @Model macro
  • CloudKit integration for iCloud syncing (Mac MD Premium only)
  • Three core entities: Document, Tag, and Project
  • Bidirectional relationships with proper cascade rules

UI Layer

  • SwiftUI exclusively - no UIKit/AppKit representables (except WebView)
  • NavigationSplitView for adaptive three-column layout
  • @Observable macro for reactive state management
  • Platform-specific adaptations where needed

Service Layer

  • MarkdownManager - Centralized Markdown parsing and rendering (@MainActor)
  • SubscriptionManager - StoreKit 2 subscription management
  • Async/await throughout (Swift 6 strict concurrency)

Project Structure

Markdown Editor/
β”œβ”€β”€ Models/              # SwiftData eßntities
β”‚   β”œβ”€β”€ Document.swift
β”‚   β”œβ”€β”€ Tag.swift
β”‚   └── Project.swift
β”œβ”€β”€ Views/
β”‚   β”œβ”€β”€ Main/           # Three-column layout
β”‚   β”œβ”€β”€ Preview/        # WebKit-based renderer
β”‚   β”œβ”€β”€ Onboarding/     # Welcome splash screen
β”‚   └── Components/     # Reusable sheets and dialogs
β”œβ”€β”€ Services/           # Business logic
β”œβ”€β”€ Utilities/          # Extensions and helpers
└── Localizable.xcstrings  # 38-language localization

πŸŽ“ Inspiration & Credits

Primary Inspirations

MacDown by Tzu-ping Chung

  • The original MacDown is a beloved open-source Markdown editor for macOS
  • Mac MD was inspired by MacDown's elegant approach to Markdown editing
  • Mac MD brings a similar experience to iOS/iPadOS with modern SwiftUI
  • If you're on macOS only, definitely check out the original MacDown!

Xcode 26.3 Intelligence Tutorial by Stewart Lynch

  • Incredible tutorial on using Xcode Intelligence (Claude integration) for SwiftUI development
  • Stewart's YouTube Channel is an amazing resource

AI Agent Development

SwiftAgents by Paul Hudson

SwiftUI Agent Skill by Antoine van der Lee

Development Tools

  • Claude by Anthropic - AI pair programming assistant
  • SwiftUI & SwiftData by Apple - Modern app development framework
  • Xcode - The amazing IDE that makes iOS development possible

πŸ“– Documentation

  • CLAUDE.md - Project memory, architecture decisions, and conventions
  • Journal.md - Engineering journey with lessons learned and best practices

πŸ—ΊοΈ Roadmap

v1.0.0 - App Store Launch βœ…

  • SwiftData schema (Document, Tag, Project)
  • Three-column NavigationSplitView layout
  • Live Markdown preview (CommonMark + GFM via swift-markdown)
  • Document CRUD with archive, favorites, sorting
  • Project and Tag CRUD with color pickers
  • Multi-select with bulk delete, move, and tag operations
  • PDF export (Mac + iOS), HTML/Markdown export (Mac only)
  • Settings: editor font, preview font, 10 color themes
  • Welcome splash screen on first launch
  • Mac MD Premium subscription (iCloud Sync via StoreKit 2)
  • iCloud sync via CloudKit (Premium only)
  • 38-language localization
  • Marketing website (GitHub Pages)

Future Ideas

  • Beta system with variables and tab stops
  • Editor intelligence (auto-pairing, smart list continuation)
  • LaTeX/Math rendering (MathJax or KaTeX)
  • macOS system extension for capturing text from any app
  • Full-text search across all documents
  • Custom export templates (CSS for HTML/PDF)
  • Document templates
  • Git integration
  • Collaborative editing via iCloud shared documents
  • Diagram support (Mermaid, PlantUML)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Special thanks to:

  • Stewart Lynch for the Xcode Intelligence tutorial that sparked this project
  • Tzu-ping Chung for creating the original MacDown
  • Paul Hudson for endless Swift education and the SwiftAgents project
  • Antoine van der Lee for detailed SwiftUI patterns and agent skills
  • The Swift Community for being amazing and supportive
  • Anthropic for Claude, which assisted in building this entire project

πŸ“§ Contact

Allen Hammock - @brainvat

Project Link: https://github.com/brainvat/markdown-editor

About

A completely vibe-coded Markdown Editor for Mac, inspired by a tutorial from Stewart Lynch with features suggested by the MacDown 3000 project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •