Friday, October 23, 2026

Building Mac App Help Books

Amy Worrall:

The documentation is available on the website for the relevant app, and also in the app as a Help Book (openable from the Help menu). These days, Help Books on MacOS open in the Tips app[…]

Apple’s documentation for making these, such as Authoring Apple Help, is pretty old. If you look at the URL for that page, you’ll see it’s part of the Carbon documentation!

There are some third party tools to help. While planning this blog article I came across Helpbook Builder. I haven’t tried it, but if I were starting afresh I would probably check it out!

In this article I’ll share my process.

Previously:

11 Comments RSS · Twitter · Mastodon


Based on experiences of ca. 4 years ago:

> Apple's documentation for making these, such as Authoring Apple Help, is pretty old.

Yup.

I think I used https://github.com/chuckhoupt/jekyll-apple-help back in the day. I think the general idea is still right: you use a static site generator to build a bunch of HTML pages that you then turn into a help bundle. You need some extra metadata, indexes, and occasional macOS Help-specific APIs (in JS, say), and then you get to this:

> MacOS caches Help Books aggressively.

This is perhaps great for end users but extremely annoying for a developer when you're just trying to test if your help book looks right. I wish there were a "exclude this bundle ID / path from caching", "disable caching for 24 hours" or whatever switch. Perhaps a developer menu item in the Tips app (née Help Viewer) that lets me open a help bundle by its path.

Although I'm not even sure about "great for end users". I went to Safari's help menu from this very tab and picked "Safari Help", and got "the selected content isn't available". Worked the second time. Not… exactly the kind of UX you want for _help_.

I also miss Apple Guide.


I don't like the Tips app. Before, it displayed your help inside your app. But with the Tips app, it takes the user out of your app, AKA "unhorsing". Plus, the Tips app aggregates all help on the system. So if the user searches for something, it's happy to suggest some other app.

And one of the key command-line tools for building Apple help books hasn't worked for years. I used to keep an older copy of the tool just to build help books.

So what I did was implement my own help display that mimics Apple's older system, with a few new features. I don't have any problem with it registering with the system. I can easily test and debug from Xcode. The bundle is still a valid help bundle, so if a user is in Tips, it will include my app's help.

Problems:
A certain developer of a popular 3rd party app inspection tool started flagging my app as unsigned because the help bundle didn't have its own signature. This is totally wrong and I told him so. I don't know if he ever fixed it. I just added a small bit of corruption to my bundle so his app wouldn't recognize it as a help bundle.

Some parts of my tool (used to) parse the help bundle content using NSAttributedString. But that caused a hang in a late version of 26. Apparently, those NSAttributeString html parsing routines are accomplished via out-of-process XPC calls! So I wrote my own XHTML parser that's much faster and more powerful than NSAttributedString ever was.

And finally, I adopted my new parser XHTML everywhere and I no longer need WebKit for my help display. I can do it with all with rich text views and no networking capabilities required.


The "Tips" app has horrible accessibility and is barely usable in VoiceOver. Papercuts galore and another nice illustration of the priority that Apple gives to macOS accessibility (or, indeed, macOS quality control, more generally). Is it SwiftUI, or Catalyst? It feels awfully like one of those.



@John Daniel What's the name of your Mac app? I tried searching all over just to see your custom Help display or some examples but I couldn't find it.


Quickly reporting back to take a guess... @John are your Mac apps EtreCheckPro and Storeograph?


Yes. the current version of EtreCheckPro uses an older version based on WebKit. It worked great for years until a recent version of 26 make some change that sometimes caused a lock-up during launch. I tracked it down to NSAttributedString making an out-of-process XPC call (to nsattributedstringagent, I assume) before the app was completely loaded.

In Storeograph, I removed the WebKit part and displayed the context with just NSTextView, but still using NSAttributedString's HTML conversion. No networking required. When I discovered the XPC behaviour in NSAttributedString, I wrote a new XHTML parser for NSAttributedString and updated the current version of Storeograph to use that. It's not a full HTML parser, but it handles most tags, images, and all the CSS I need.


@John I, too, am seeing some hangs due to the new nsattributedstringagent.


Inevitable latency aside (and of course, it doesn’t seem Apple has documented nsattributedstringagent‘s existence anywhere), I assume they’re trying to mitigate malicious inputs. Would be nice if there were a way to opt into a simpler parsing that never goes out of process and only supports a safe subset of RTF.


@Sören Not sure, but I think maybe nsattributedstringagent is only used for reading HTML, not RTF. It seems like they moved the calls to in-process WebKit to a separate process instead of updating it to use out-of-process WebKit.


I think the new agent is, at least in part, meant to solve the single threaded nature of WebKit, where multiple threads would bottleneck and sometimes deadlock on a jump to the main thread so WebKit could render the HTML into an attributed string.

Leave a Comment