Implemented split-view editor with real-time markdown preview: - Added Edit/Preview toggle button with toolbar - Created MarkdownEditor component using NSTextView for raw markdown editing - Implemented HSplitView with editor on left and live preview on right - Fixed NSTextView width constraints to prevent unwanted scaling - Added proper text container configuration for word wrapping - Text changes update preview in real-time via SwiftUI binding 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2.3 KiB
2.3 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This repository contains a macOS markdown viewer application built with SwiftUI. The app allows users to open markdown files and render them with HTML preview in individual windows.
Development Commands
- Build:
xcodebuild -project MarkdownViewer.xcodeproj -scheme MarkdownViewer -configuration Debug - Clean:
xcodebuild clean -project MarkdownViewer.xcodeproj - Open in Xcode:
open MarkdownViewer.xcodeproj
Architecture & Structure
- MarkdownViewerApp.swift: Main app entry point with Settings scene and File menu integration
- ContentView.swift: Contains MarkdownDocumentView for displaying markdown content
- MarkdownRenderer.swift: NSViewRepresentable wrapper for WKWebView with markdown-to-HTML conversion
- MarkdownViewer.entitlements: App entitlements with sandbox disabled for WebView functionality
Getting Started
- Open the project:
open MarkdownViewer.xcodeproj - Build and run the application in Xcode (⌘R)
- Use File → Open Markdown File (⌘O) to open markdown files
- Each file opens in its own window with rendered HTML preview
TODO - Feature Ideas
Add new feature ideas here that can be worked on in future development sessions
Markdown Viewer Enhancements
- Add syntax highlighting for code blocks
- Support for markdown tables
- Add print functionality
- Export to PDF feature
- Dark mode support
- Custom CSS themes
- Live preview while editing
- Search within document
- Zoom in/out functionality
- Recent files menu
- Drag and drop file support
- Support for math equations (LaTeX)
- Image paste support
- Full-screen reading mode
- Support for markdown extensions (strikethrough, task lists, etc.)
- Auto-save functionality for edited files
- Split view with source and preview
- Outline/table of contents sidebar
- Word count and reading time estimation
Technical Improvements
- Add unit tests for markdown parsing
- Implement proper error handling and user feedback
- Add app icon and proper branding
- Optimize performance for large markdown files
- Add preferences/settings window
- Implement proper document state management