Compile MacDown for Apple silicon

Restores "Recent Documents" to the MacDown Dock icon in Sequoia and drops the Rosetta 2 dependency (macOS 27 will be the last to fully support it). Install Xcode and brew then run:

#!/bin/bash
set -euo pipefail

echo "Installing dependencies..."
brew install ruby@3.2

# Add Ruby and gem binaries to PATH (avoids duplicate lines in ~/.zshrc)
echo "Configuring Ruby path..."
LINE='export PATH="/opt/homebrew/opt/ruby@3.2/bin:/opt/homebrew/lib/ruby/gems/3.2.0/bin:$PATH"'
grep -Fxq "$LINE" ~/.zshrc || echo "$LINE" >> ~/.zshrc
export PATH="/opt/homebrew/opt/ruby@3.2/bin:/opt/homebrew/lib/ruby/gems/3.2.0/bin:$PATH"

# Uninstall any outdated Bundler versions
echo "Cleaning bundler..."
[ -d /opt/homebrew/lib/ruby/gems/3.2.0 ] && gem uninstall -aIx bundler || true

echo "Installing bundler and CocoaPods..."
gem install bundler cocoapods

echo "Cloning MacDown..."
git clone --recurse-submodules https://github.com/MacDownApp/macdown
cd macdown

# The next 4 commands are only necessary if you want the last official pre-release version, 0.8.0d71 (1079)
# rather than the default 0.8.0d32 (1111) version:

git checkout v0.8.0d71
git submodule update --init --recursive

# Work around broken Slovak localization file in v0.8.0d71
echo "Replacing broken Slovak localization file..."
echo '"DUMMY_KEY" = "DUMMY_VALUE";' > MacDown/Localization/sk.lproj/Localizable.strings

echo "Removing outdated Gemfile.lock..."
rm -f Gemfile.lock

echo "Installing Ruby dependencies..."
bundle install

echo "Installing CocoaPods dependencies..."
ruby -e 'require "logger"; exec "pod", *ARGV' install

echo "Building PEG Markdown parser..."
make -C Dependency/peg-markdown-highlight -j$(sysctl -n hw.ncpu)

echo "Opening Xcode..."
open MacDown.xcworkspace

cat <<EOF

Setup complete.

When Xcode opens, press Cmd+B to build; find MacDown.app via
Product > Show Build Folder in Finder > Products/Debug
EOF

Notes

❧ 2025-08-06