Franklin Schrans

@franklin_
91 Followers
58 Following
15 Posts

Some truly game-changing improvements to Swift-DocC documentation are available in an Xcode 15 beta near you. Some highlights are in the thread below, but check out the "Create rich documentation with Swift-DocC" session to learn more. 🧵

#WWDC23

https://developer.apple.com/videos/play/wwdc2023/10244/

Create rich documentation with Swift-DocC - WWDC23 - Videos - Apple Developer

Learn how you can take advantage of the latest features in Swift-DocC to create rich and detailed documentation for your app or...

Apple Developer
@simonbs Hm they should be picked up by your manual `docc` invocation as well. Are you passing the catalog in the invocation?
@simonbs Are they marked unavailable on those platforms using `@available`? If so, I'd expect DocC to not show them as available on iOS/Mac Catalyst.
@simonbs Ah, try replacing "FillIntroduced" with the name of your target Tinystone. In the example I sent you, the target was called "FillIntroduced".

@simonbs That's because DocC doesn't know what the 'default' availability of symbols are, i.e., which platform + OS version they're available in. It's not necessarily the version associated with the toolchain you used to compile documentation, since in many cases you want to be backwards compatible with older clients.

You can define your default availabilities in your DocC Info.plist file, like in this example: https://github.com/apple/swift-docc/blob/main/Tests/SwiftDocCTests/Test%20Bundles/TestBundle.docc/Info.plist#L25

swift-docc/Info.plist at main · apple/swift-docc

Documentation compiler that produces rich API reference documentation and interactive tutorials for your Swift framework or package. - swift-docc/Info.plist at main · apple/swift-docc

GitHub
@simonbs Right, so what you could do is to Build Documentation for each platform of your target, and collect all the generated `.symbols.json` files from DerivedData into one folder. Then copy/paste one invocation of `docc` from a build log and change the `--additional-symbol-graph-dir` argument to your folder and run that.

@simonbs Right, that's not possible out-of-the-box today. We'd need support in the build system for multi-platform products first.

If you generate symbol graph files manually from the Swift compiler though for each platform, you can provide all of them to DocC and it will merge them together into a single page. For example https://developer.apple.com/documentation/swiftui/app

Apple Developer Documentation

it might be cold rn in London, but at least it’s sunny
It took a while, but #DocC extension support is finally ready for you to try! Check out my post on the #Swift Forums for instructions and more: https://forums.swift.org/t/enablement-of-docc-extension-support-as-an-opt-in-feature/62614. Thanks to everyone who helped me make it happen!
Enablement of DocC Extension Support as an Opt-In Feature

Hi everyone! Back in March I pitched Documenting Extensions to External Types using DocC. Today, over nine months, and twelve PRs to six repositories later, development is completed and I'm happy to announce it's finally time for you to try it out! Before I get into the details of using it, I want to thank everyone who's helped me along the way, by participating in discussions, reporting bugs, reviewing PRs, or otherwise. Special thanks to @daniel-grumberg, @ronnqvist, @ethankusters, @franklin,...

Swift Forums
@KevinHoctor All the best, Kevin! And come say hi if you're in London 🙂