Skip to content

nerkza/GlassMark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glassmark

Glassmark

A fast, native macOS Markdown editor that does one thing well.

Edit Markdown with a beautiful live preview — calm, local, folder-based.
No cloud, no accounts, no plugins. Your files stay on your machine.

macOS 15+ Swift 6 Built with SwiftUI Offline preview 74 tests passing License MIT Stars Buy me a coffee

Features · Installation · Shortcuts · Build · Report a bug · Buy me a coffee

Coming soon to the Mac App Store

Glassmark split-view editor and live preview


Most Markdown apps want to be a publishing platform, an IDE, or a second brain. Glassmark wants to be the calmest, fastest way to write Markdown and see it rendered as you type. Open a folder, browse your .md files in a sidebar, edit on the left, watch the preview keep pace on the right. That's it — and it's polished to a shine.

Everything renders natively and offline: code highlighting, math, and diagrams are vendored into the app, so nothing is fetched from the network and your documents never leave your Mac.


Screenshots

Syntax-highlighted code and KaTeX math

Syntax-highlighted code (highlight.js) and rendered math (KaTeX) — all offline.

Mermaid diagrams rendered in the preview

Mermaid diagrams and GFM tables, rendered live as you type.


Features

Live preview Updates as you type — debounced, flicker-free, scroll position preserved.
↕️ Line-mapped scroll sync Scroll either pane in split mode and the other follows to the same source line.
🎨 GitHub-flavored Markdown Headings, bold/italic/strike, links, images, tables, task lists, nested lists, blockquotes, autolinks, and footnotes.
🌈 Offline rich preview Syntax-highlighted code (highlight.js), math (KaTeX $…$ / $$…$$), and diagrams (Mermaid) — all bundled, nothing fetched.
✍️ Editor that feels alive In-editor syntax highlighting, auto-pairing, automatic list continuation, and Tab-to-next-cell in tables.
🧘 Calm-writing modes Focus mode dims everything but the current paragraph; typewriter scrolling keeps your line centered.
🗂️ Outline panel Jump to any heading, with the current section highlighted as you scroll.
🎭 Themes + custom CSS System, Sepia, High Contrast, and Dark preview themes — plus your own stylesheet.
📤 Export One-click export to HTML or PDF.
🪟 Multiple workspaces Remembered folders with security-scoped bookmarks, a workspace rail, and per-workspace colors.
🧰 Full file management Create, rename, duplicate, cut/copy/paste, drag-to-move, delete-to-Trash, reveal in Finder.
🔎 Quick Open & Find Fuzzy file switching (⌘P) and the native find bar (⌘F).
💾 Autosave & session restore Optional autosave; reopens the files you had open per workspace.
🧮 Live stats Word, character, and line counts plus estimated reading time.

Built with SwiftUI and an AppKit NSTextView editor, a WKWebView preview, and a dependency-free Markdown renderer that escapes all input and blocks unsafe URL schemes.


Installation

🍎 Coming soon to the Mac App Store. In the meantime, build from source (it takes under a minute).

Build from source

# Requirements: macOS 15+, Xcode 26, and XcodeGen (brew install xcodegen)
git clone https://github.com/nerkza/GlassMark.git
cd GlassMark
xcodegen generate
open GlassMark.xcodeproj   # then ⌘R, or use the helper below

Or build and launch from the command line:

script/build_and_run.sh

Updates

The Mac App Store build updates itself automatically. The direct-download build (notarized Releases) checks GitHub for a newer version on launch and offers to open the download page — toggleable in Settings → General, and it sends no personal data. Maintainers cut a release with script/release.sh (see the script header for the one-time signing/notarization setup).


Keyboard shortcuts

Action Shortcut
New Markdown file ⌘N
Open workspace ⇧⌘O
Quick Open ⌘P
Save ⌘S
Find ⌘F
Refresh workspace ⌘R
Toggle outline ⌥⌘0
Focus mode ⌃⌘F
Bold / Italic / Inline code ⌘B / ⌘I / ⌘E
Strikethrough ⇧⌘X
Insert link ⌘K
Heading 1–3 ⌃⌘1 / ⌃⌘2 / ⌃⌘3
Export as HTML / PDF File menu

Building from source

Glassmark is generated with XcodeGen from project.yml, so the .xcodeproj is reproducible. After editing project.yml, regenerate it:

xcodegen generate

Build and run the test suite:

xcodebuild -project GlassMark.xcodeproj -scheme GlassMark -configuration Debug -derivedDataPath DerivedData build
xcodebuild -project GlassMark.xcodeproj -scheme GlassMark -derivedDataPath DerivedData test

Architecture

  • SwiftUI app shell built around a NavigationSplitView — workspace rail + file tree, editor/preview detail, and an outline inspector.
  • AppKit NSTextView editor bridge for syntax highlighting, list continuation, auto-pairing, and the find bar.
  • WKWebView preview using a persistent HTML shell updated via JavaScript (no full reloads), kept scroll-synced to the editor by source line.
  • Dependency-free MarkdownHTMLRenderer producing escaped, sanitized HTML.
  • Vendored web assets (highlight.js, KaTeX, Mermaid) served to the preview over a custom WKURLSchemeHandler, so the preview is fully offline.
  • Clear separation of stores (workspace, document, command, preferences) and services (file tree, persistence, rendering, export).

Roadmap

Glassmark is at its 1.0 milestone. Things on the horizon (kept in scope — no PKM, cloud, or plugins):

  • Image paste/drag that saves into the workspace
  • On-demand table column alignment
  • Incremental preview DOM updates
  • Larger-workspace performance profiling

Contributing

Issues and pull requests are welcome. Glassmark deliberately stays narrow — a fast, beautiful Markdown preview editor — so the best contributions sharpen that core rather than broadening scope. Please run the test suite before opening a PR.


Support the project

Glassmark is free and MIT-licensed. If it's found a place in your writing, you can support its development:

Buy me a coffee

Starring the repo helps too — thank you. ☕️


License

Glassmark is released under the MIT License.

Acknowledgements

About

A fast, native macOS Markdown editor with a beautiful live preview — syntax-highlighted code, math, and diagrams, all rendered offline.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors