Browse these using Outer Loop.
- Swift: https://probablymarcus.com/cookbook-macos-swift.outer
- C: https://probablymarcus.com/cookbook-macos-objc.outer
Source code:
swift/contains the Swift cookbook sources forcookbook-macos-swift.outerobjc/contains the Objective-C cookbook sources forcookbook-macos-objc.outer
Both cookbooks have the same set of recipes.
The repo has one Xcode project, OuterframeCookbook.xcodeproj, with two bundle targets:
OuterframeCookbookSwiftOuterframeCookbookObjC
The shared OuterframeCookbooks scheme builds both targets.
From this directory:
./build_site.shThat produces a ready-to-upload static site in build/site/:
cookbook-macos-swift.outercookbook-macos-objc.outerbinaries/OuterframeCookbookSwift/binaries/OuterframeCookbookObjC/
By default, generated .outer files point at /binaries/..., so the uploaded site is intended to live at a web server root. Override the binary URLs when hosting under a subpath:
SWIFT_BINARY_URL_PATH=/demo/binaries/OuterframeCookbookSwift \
OBJC_BINARY_URL_PATH=/demo/binaries/OuterframeCookbookObjC \
./build_site.shEach language folder also has its own build_site.sh for building only that cookbook through the shared Xcode project.
Build the site, then serve it locally:
python3 Scripts/serve_site.py --root build/site --port 8025Then open either URL in Outer Loop:
http://127.0.0.1:8025/cookbook-macos-swift.outer
http://127.0.0.1:8025/cookbook-macos-objc.outer
Upload the contents of build/site/ to your server.
The server needs to satisfy these rules:
cookbook-macos-swift.outerandcookbook-macos-objc.outershould be served asapplication/vnd.outerframebinaries/OuterframeCookbookSwift/macos-arm,binaries/OuterframeCookbookSwift/macos-x86,binaries/OuterframeCookbookObjC/macos-arm, andbinaries/OuterframeCookbookObjC/macos-x86should be served as raw binary data
build_site.sh also writes index.html files under each binary directory with a plain-text list of supported platforms. Current Outer Loop builds directly request the current platform archive, but the listings are harmless to upload.
Put the correct Content-Type metadata on the S3 objects.
If the site is hosted at the bucket root:
BUCKET=your-bucket-name
for cookbook in cookbook-macos-swift cookbook-macos-objc; do
aws s3 cp "build/site/${cookbook}.outer" "s3://${BUCKET}/${cookbook}.outer" \
--content-type "application/vnd.outerframe"
done
for app in OuterframeCookbookSwift OuterframeCookbookObjC; do
aws s3 cp "build/site/binaries/${app}/index.html" "s3://${BUCKET}/binaries/${app}/index.html" \
--content-type "text/plain; charset=utf-8"
for platform in macos-arm macos-x86; do
aws s3 cp "build/site/binaries/${app}/${platform}" "s3://${BUCKET}/binaries/${app}/${platform}" \
--content-type "application/octet-stream"
done
doneIf the site is hosted under an S3 path prefix, rebuild with matching binary paths and upload to the same prefix:
PREFIX=demo
SWIFT_BINARY_URL_PATH="/${PREFIX}/binaries/OuterframeCookbookSwift" \
OBJC_BINARY_URL_PATH="/${PREFIX}/binaries/OuterframeCookbookObjC" \
./build_site.sh
for cookbook in cookbook-macos-swift cookbook-macos-objc; do
aws s3 cp "build/site/${cookbook}.outer" "s3://${BUCKET}/${PREFIX}/${cookbook}.outer" \
--content-type "application/vnd.outerframe"
done
for app in OuterframeCookbookSwift OuterframeCookbookObjC; do
aws s3 cp "build/site/binaries/${app}/index.html" "s3://${BUCKET}/${PREFIX}/binaries/${app}/index.html" \
--content-type "text/plain; charset=utf-8"
for platform in macos-arm macos-x86; do
aws s3 cp "build/site/binaries/${app}/${platform}" "s3://${BUCKET}/${PREFIX}/binaries/${app}/${platform}" \
--content-type "application/octet-stream"
done
doneCheck the deployed metadata:
curl -I https://your-domain.example/cookbook-macos-swift.outer
curl -I https://your-domain.example/cookbook-macos-objc.outer
curl -I https://your-domain.example/binaries/OuterframeCookbookSwift/macos-arm
curl -I https://your-domain.example/binaries/OuterframeCookbookObjC/macos-armThe .outer responses must include Content-Type: application/vnd.outerframe. The platform archive responses should be application/octet-stream.
After upload, navigate Outer Loop to the deployed .outer URLs.
The Objective-C cookbook vendors the same Vendor/OuterframeC and Vendor/Common files as ~/dev/src/hello-outerframe-macOS-objc. When those vendored files need changes, update both copies together so the cookbook remains a realistic manual test target for the Objective-C library.