Skip to content
rempairamorePublic

About

Lightweight native Markdown viewer for macOS

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

MDMAc app icon: a two-tone capsule with the Markdown mark and the Mac command key

MDMAc

A lightweight, native Markdown viewer for macOS.

Latest release Requires macOS 13 or later Universal binary for Apple silicon and Intel Install with Homebrew: rempairamore/tap/mdmac License: GPL-3.0

MDMAc showing its own README: a table of contents on the left, the Homebrew install command and a table of Homebrew commands on the right, and buttons for TextEdit, CotEditor and VSCodium at the top

MDMAc opens your Markdown files in a clean, rendered preview. A table of contents on the left takes you to any section, and the buttons at the top open the same file in your editor with one click. Press the space bar on a Markdown file in Finder and you get the same preview in Quick Look, without opening the app.

Features

  • Read, don't edit. Headings, tables, task lists, code blocks, images and links, rendered the way GitHub renders them. MDMAc never changes your files.
  • Find your way. The sidebar lists every heading and highlights the one you are reading. Click a heading to jump to it.
  • Open in your editor. Up to three buttons, one per editor: VS Code, TextEdit and CotEditor at first, any app from your Applications folder after.
  • Always up to date. Save the file in your editor and the preview refreshes, keeping your place on the page.
  • Your size. Zoom in and out with ⌘+ and ⌘-, or with the buttons at the top. MDMAc remembers it.
  • Pick up where you left off. The welcome window lists the files you opened recently.
  • Quick Look. Select a Markdown file in Finder and press the space bar for an instant preview.
  • Every spelling of Markdown. .md, .markdown, .mkd, .mdown, R Markdown (.rmd), Quarto (.qmd) and more.
  • Light and dark. Follows macOS, or pick one in Settings.
  • Small and private. A native app, under 1 MB to download, that works offline and never runs scripts hidden in a document.

Install

Homebrew

brew install --cask rempairamore/tap/mdmac

Download

  1. From the latest release, download MDMAc_v<version>.dmg. The same app runs on Apple silicon and Intel Macs.
  2. Open it and drag MDMAc into Applications.

Note

MDMAc is not notarized by Apple, so macOS stops it the first time you open it. Open System Settings → Privacy & Security, click Open Anyway, and open MDMAc again. You only do this once per version.

Make it your Markdown app

MDMAc opens the less common spellings (.mkd, .rmd, .qmd…) on its own. For .md and .markdown, open MDMAc → Settings (⌘,) and click Make MDMAc the default. In Finder you can also select a .md file, choose File → Get Info, pick MDMAc under Open with and click Change All….

Quick start

  • Open a file: double-click it in Finder, or drag it onto the MDMAc icon. When MDMAc starts on its own, the welcome window lists your recent files: click one, drop a file on the window, or click Open .md file (⌘O). Window → Welcome to MDMAc (⇧⌘1) brings it back.
  • Jump to a section: click a heading in the sidebar. The sidebar button at the top left hides it and gives the document the whole window.
  • Edit it: click your editor's button at the top. Save, and the preview follows.
  • Change the text size: ⌘+ and ⌘-, or the magnifying glasses next to the editor buttons. ⌘0 goes back to 100%. The size applies to every window.
  • Peek without opening: select a Markdown file in Finder and press the space bar. Quick Look turns on after you open MDMAc once.

Animation: in Finder, README.md is selected and the space bar pressed; Quick Look shows it rendered by MDMAc, images included. Then the same for Meeting notes.mkd

A quick tour

MDMAc Settings: three editor buttons (TextEdit, CotEditor, VSCodium) with arrows to reorder them, and the theme, reload and default app options

  • Editor buttons: choose up to three editors with Add editor…, rename a button by clicking its label, and change the order with the arrows: the top one is the leftmost in the window. Restore defaults brings back VS Code, TextEdit and CotEditor.
  • Theme: automatic, light or dark.
  • Reload when the file changes: turn it off if you prefer the preview to stay as it was when you opened it.
  • Links to other Markdown files open in MDMAc, links to websites open in your browser, and links to other files show them in Finder.

Update

brew upgrade --cask rempairamore/tap/mdmac

If you downloaded the DMG, drag the new MDMAc into Applications and replace the old one. Your settings are kept.

Uninstall

brew uninstall --cask rempairamore/tap/mdmac

Add --zap to also remove its settings and caches. Without Homebrew, drag MDMAc from Applications to the Trash.

Troubleshooting

What you see What to do
"MDMAc" can't be opened Open System Settings → Privacy & Security and click Open Anyway.
The space bar shows plain text or another app's preview Open MDMAc once. If another app also previews Markdown (Glance, QLMarkdown…), turn off the one you don't want under System Settings → General → Login Items & Extensions → Quick Look.
Quick Look still shows the old version after an update Run qlmanage -r in Terminal.
.md files still open in another app MDMAc → Settings → Make MDMAc the default.
An editor button says the editor isn't installed Remove it in Settings and choose another editor with Add editor….
An image is missing MDMAc shows images stored next to the file and images from the web. In Quick Look, images from the web may not appear.

Good to know

  • MDMAc is a viewer: it reads files and never writes them.
  • Markdown can contain HTML. MDMAc shows it, but never runs scripts from a document, in the app or in Quick Look. Links to files that are not Markdown are shown in Finder, never launched.
  • YAML front matter at the top of a file (between --- lines) is hidden.
Supported file types

.md, .markdown, .mdown, .mdwn, .mkd, .mkdn, .mkdown, .markdn, .mdtxt, .mdtext, .rmd (R Markdown), .qmd (Quarto) and .livemd (Livebook).

macOS knows the standard Markdown type (net.daringfireball.markdown) only for .md, .markdown and .mdown. MDMAc declares its own type, app.mdmac.markdown, for the other spellings. The app and Quick Look also accept the Markdown types other apps declare: public.markdown, net.ia.markdown (iA Writer), com.unknown.md and org.quarto.qmarkdown (Quarto).

What MDMAc puts on your Mac
  • /Applications/MDMAc.app, with the Quick Look extension inside (Contents/PlugIns/MDMAcQuickLook.appex).
  • Settings: ~/Library/Preferences/app.mdmac.MDMAc.plist.
  • Caches of the preview: ~/Library/Caches/app.mdmac.MDMAc and ~/Library/WebKit/app.mdmac.MDMAc.
  • The Quick Look extension's sandbox: ~/Library/Containers/app.mdmac.MDMAc.QuickLook. The extension can read files, so it can show images next to a document, but cannot write them or reach the network.

brew uninstall --zap removes all of them.

For developers

Build it yourself

You need macOS 13 or later and Xcode 15 or later.

git clone https://github.com/rempairamore/MDMAc.git
cd MDMAc
scripts/build.sh

scripts/build.sh builds build/MDMAc.app, a Universal binary (arm64 + x86_64) with the Quick Look extension, signs it ad hoc and packs it into build/MDMAc_v<version>.dmg. It also prints the version and sha256 for the Homebrew cask.

Variable Default Meaning
VERSION the VERSION file CFBundleShortVersionString and DMG name
BUILD same as VERSION CFBundleVersion
SIGN_ID - (ad hoc) Signing identity, for example "Developer ID Application: Your Name (TEAMID)"
Signing and notarizing with a Developer ID
SIGN_ID="Developer ID Application: Your Name (TEAMID)" scripts/build.sh
xcrun notarytool submit build/MDMAc_v1.0.0.dmg --keychain-profile <profile> --wait
xcrun stapler staple build/MDMAc_v1.0.0.dmg

Release a new version

  1. Raise the number in VERSION (for example 1.0.1) and add a ## v1.0.1 section to CHANGELOG.md.
  2. Merge to main.

The release workflow builds the Universal DMG on GitHub's Macs, attests its build provenance, scans it with VirusTotal and publishes the release, with the changelog section as notes. Then it opens and merges a pull request in rempairamore/homebrew-tap that updates version and sha256 in Casks/mdmac.rb, once brew style and brew audit --cask --strict --online pass.

Pull requests only build the DMG and attach it to the run. A tag like v1.0.1-rc.1 publishes a prerelease and leaves Homebrew alone.

Repository secret Used for
HOMEBREW_TAP_TOKEN Updating the tap: a fine-grained token with read and write access to Contents and Pull requests of rempairamore/homebrew-tap
VIRUSTOTAL_API_KEY The VirusTotal scan, skipped without it

Where things are

Sources/MDMAc/            The app
  MDMAcApp.swift          App entry, Markdown types, theme
  DocumentView.swift      Window: table of contents, preview, zoom and editor buttons
  Welcome.swift           Welcome window and recent files
  DocumentModel.swift     Web view, rendering, link handling
  FileWatcher.swift       Reload on save (also when editors replace the file)
  Editors.swift           Editor buttons: storage and "Open in…"
  SettingsView.swift      Settings window
Sources/MDMAcQuickLook/   The Quick Look extension: Markdown to a self-contained HTML page
Resources/                Info.plist files, sandbox entitlements, icon, web/ (page, stylesheet, renderer)
scripts/build.sh          Universal build, signing, DMG
scripts/make-icon.swift   Draws the app icon
.github/workflows/        Release and Homebrew tap update
VERSION, CHANGELOG.md     Version of the next release and its notes

To redraw the icon:

swift scripts/make-icon.swift /tmp/AppIcon.iconset && iconutil -c icns /tmp/AppIcon.iconset -o Resources/AppIcon.icns

License

MDMAc is free software, released under the GNU General Public License v3.0.

Markdown is parsed by marked, bundled in Resources/web/marked.js so MDMAc works offline, under its own MIT license.

About

Lightweight native Markdown viewer for macOS

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages