macOS Markdown File Association
March 29, 2026 · View on GitHub
Overview
Ferrite’s macOS .app bundle declares the standard Markdown UTI (net.daringfireball.markdown) so Finder can offer Open With → Ferrite and users can set Ferrite as the default app for .md and related extensions. This uses both imported type declarations and document types merged into Info.plist at bundle time.
Key Files
assets/macos/info_plist_ext.xml— Plist fragment merged bycargo-bundle:UTImportedTypeDeclarationsfor the Markdown UTI, plusCFBundleDocumentTypesfor editor role and extensions.Cargo.toml—[package.metadata.bundle]→osx_info_plist_exts = ["assets/macos/info_plist_ext.xml"]..github/workflows/release.yml— macOS release jobs runcargo bundle --release(Intel uses--target x86_64-apple-darwin); the merged plist ships insideFerrite.appin DMG/tar artifacts.
Implementation Details
- UTI:
net.daringfireball.markdown(reference: Daring Fireball Markdown), conforming topublic.plain-text. - Extensions:
md,markdown,mdown,mkd,mkdn. UTImportedTypeDeclarations: Imports the UTI so the system knows how.mdfiles relate to the declared type when resolving handlers.CFBundleDocumentTypes: Registers Ferrite as an editor for that UTI (and related content types), alongside JSON, YAML, TOML, and plain text entries in the same fragment.
CI does not patch Info.plist separately; cargo-bundle reads osx_info_plist_exts from Cargo.toml on every build.
Dependencies Used
- cargo-bundle — Produces
Ferrite.appand mergesinfo_plist_ext.xmlintoContents/Info.plist.
Usage
Verify the merged plist (macOS)
After a local bundle build:
cargo install cargo-bundle # once
cargo bundle --release
plutil -p target/release/bundle/osx/Ferrite.app/Contents/Info.plist | head -80
Confirm entries for UTImportedTypeDeclarations / CFBundleDocumentTypes and net.daringfireball.markdown.
Manual UX check
- Install or run
Ferrite.appfrom a release DMG or localcargo bundle. - In Finder, right-click a
.mdfile → Open With — Ferrite should appear. - Optionally set as default — double-click should open Ferrite.
Related
- macOS .app Bundle CI — CI packaging and
cargo-bundlesetup. - GitHub: #102