Add Finder Quick Actions for exporting Markdown - #255
Draft
mfauzaan wants to merge 3 commits into
Draft
Conversation
Ship four Finder Quick Actions — Create PDF, Create PNG, Create HTML and a combined Export Markdown — as Action extensions embedded in the app. Each exports beside the source file the way Finder's own Convert Image does, with no destination picker and Finder-style collision naming, and none of them launch the main app. The four targets share one source folder and Info.plist, differing only by FINDER_ACTION_ICON_NAME and the format they are compiled for. Icons are generated to match Apple's built-in Finder actions rather than approximated by hand; see scripts/generate-action-icons.swift for the measured spec and the two non-obvious findings behind it (the list draws icons as authored and does not composite the grey plate, and it renders them 19/255 darker than authored). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The plate is not a flat fill. Sampling a column down Apple's tiles gives ~#B4B4B9 at the top falling to systemGray #8E8E93 about 60% of the way down and staying there — a subtle top-lit sheen that a flat plate visibly lacks side by side. Create PDF and Convert Image measure identically, so it is a system treatment rather than per-icon artwork. Their plate is also 26x26pt, not the 28 measured earlier; the extra 2pt made ours read slightly heavy. Also corrects a wrong note in the generator. The claim that the list composites icons 19/255 darker was a measurement artifact: raw bitmap samples come back in the display's space, where #8E8E93 reads as #7B7B81. Converting samples to sRGB first shows the pipeline is transparent. Verified live against the six built-in Finder actions: plate height and the gradient now track Apple's within a few levels per row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reduce the padding around each glyph and draw them a step heavier — 16pt in the 26pt plate at .medium rather than 14pt at .regular. Apple's own glyphs read thin and float at this size. Create PNG now uses photo.on.rectangle.angled, the same glyph Finder's Convert Image uses, whose width sits much closer to Apple's than plain photo. Create HTML uses safari. Drawing the glyphs switches from NSSymbolImageRep's `outlinePath` to the symbol image itself. That property returns a simplified union for layered symbols — it filled photo.on.rectangle.angled's front photo solid, losing the mountain and sun — and it was only needed while these were vector PDFs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mfauzaan
marked this pull request as draft
August 14, 2026 07:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four Finder Quick Actions — Create PDF, Create PNG, Create HTML, and a combined Export Markdown — as Action extensions embedded in the app.
Right-click a Markdown file → Quick Actions → pick a format. Each one exports beside the source file the way Finder's own Convert Image does: no destination picker, Finder-style collision naming (
full 2.pdf), and the main app never launches. The three format-specific actions still show the preview/font-size sheet, just with the format selector hidden.The four targets share one source folder and one
Info.plist, differing only byFINDER_ACTION_ICON_NAMEand the format they're compiled for.Icons
The icons are generated to match Apple's built-in Finder actions rather than approximated by hand —
scripts/generate-action-icons.swiftregenerates them and documents the spec, measured off Apple's own Create PDF as rendered in Login Items & Extensions:#B4B4B9→#8E8E93Glyphs are Apple's real SF Symbol outlines (
doc,photo,chevron.left.forwardslash.chevron.right,arrow.up.doc), read fromNSSymbolImageRep'soutlinePathrather than redrawn.docis the same page-with-top-right-fold silhouette Finder uses for Create PDF, so that one is 1:1 and the others follow the same construction.Two non-obvious findings, both commented in the generator so they aren't "fixed" later:
#B4B4B9at the top falling to systemGray#8E8E93about 60% of the way down, then holding — a subtle top-lit sheen. Create PDF and Convert Image measure identically, so it's a system treatment, not per-icon artwork. A flat plate is visibly duller side by side.#8E8E93reads as#7B7B81.PNG at 1x/2x rather than vector PDF: a fill in a
CGPDFContextis written untagged and gets reinterpreted, whereas PNG carries an explicit sRGB profile.Notes for review
Two undocumented
Info.plistkeys are load-bearing here, verified by removing each and observing the breakage (both now carry comments):NSExtensionServiceAllowsFinderPreviewItemthe actions disappear from Finder's list entirelyNSExtensionServiceFinderPreviewIconNamethe rows fall back to the containing app's iconThe changes to
MarkdownWebView.swift/MarkdownHTML.swiftare small#if EXPORT_ACTION_EXTENSIONguards that compile the Mermaid popup and vendor warm-up out of the extension.On a fresh install users must enable these once in System Settings → General → Login Items & Extensions → Actions. That's unavoidable for third-party Action extensions; Apple's built-ins are Finder-internal and exempt. Worth a first-launch prompt as a follow-up.
Test plan
main#7B7B81, identical to all six Apple built-ins (Rotate Left, Markup, Create PDF, Trim, Convert Image, Remove Background)🤖 Generated with Claude Code