Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the [installation docs](docs/installation/) for setup instructions:

- [VS Code](docs/installation/vscode.md)
- [macOS Quick Look](editors/macos/README.md) — Finder file recognition + syntax-highlighted preview for `.jaw` files

## Syntax

Expand Down
8 changes: 8 additions & 0 deletions editors/macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated by `xcodegen generate` — do not commit.
JAWQuickLook.xcodeproj/

# Xcode build output & local state.
build/
DerivedData/
*.xcuserstate
xcuserdata/
79 changes: 79 additions & 0 deletions editors/macos/JAWQuickLook/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>JAW Quick Look</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHumanReadableCopyright</key>
<string>JAW — Just A Word. MIT Licensed.</string>

<!-- Tell Launch Services this app understands .jaw documents. Pairs with the
exported type below so Finder shows the right kind/icon and routes Quick
Look to our extension. -->
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>JAW Pseudocode</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.dishmint.jaw.source</string>
</array>
</dict>
</array>

<!-- Export the JAW Uniform Type Identifier. This is what makes .jaw a
recognized file type system-wide (the "unknown file" fix from #63). It
conforms to public.source-code, so even without our extension macOS will
fall back to a plain-text Quick Look preview. -->
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.dishmint.jaw.source</string>
<key>UTTypeDescription</key>
<string>JAW Pseudocode</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.source-code</string>
<string>public.utf8-plain-text</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>jaw</string>
</array>
<key>public.mime-type</key>
<array>
<string>text/x-jaw</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
10 changes: 10 additions & 0 deletions editors/macos/JAWQuickLook/JAWQuickLook.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
38 changes: 38 additions & 0 deletions editors/macos/JAWQuickLook/JAWQuickLookApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import SwiftUI

// The container app exists so macOS has somewhere to register the `jaw` UTI and
// load the Quick Look extension. It shows a short explainer window; the real work
// happens in JAWQuickLookExtension.
@main
struct JAWQuickLookApp: App {
var body: some Scene {
WindowGroup("JAW Quick Look") {
ContentView()
}
}
}

struct ContentView: View {
var body: some View {
VStack(alignment: .leading, spacing: 14) {
Text("JAW Quick Look")
.font(.system(size: 22, weight: .bold))

Text("This app registers the .jaw file type with macOS and provides a "
+ "syntax-highlighted Quick Look preview.")
.fixedSize(horizontal: false, vertical: true)

Divider()

VStack(alignment: .leading, spacing: 8) {
Label("Keep this app in /Applications.", systemImage: "folder")
Label("Select a .jaw file in Finder and press Space.", systemImage: "space")
Label("You can quit this window — the preview keeps working.",
systemImage: "checkmark.seal")
}
.font(.callout)
}
.padding(28)
.frame(width: 420)
}
}
42 changes: 42 additions & 0 deletions editors/macos/JAWQuickLookExtension/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>JAW Preview</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.quicklook.preview</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).PreviewViewController</string>
<key>NSExtensionAttributes</key>
<dict>
<!-- Only fire for JAW files. Must match the UTI exported by the
container app's Info.plist. -->
<key>QLSupportedContentTypes</key>
<array>
<string>com.dishmint.jaw.source</string>
</array>
<key>QLSupportsSearchableItems</key>
<false/>
</dict>
</dict>
</dict>
</plist>
Loading