[swift-dev] Looking for documentation/insight on .swiftdoc
Douglas Gregor
dgregor at apple.com
Tue Oct 24 15:06:29 CDT 2017
> On Oct 23, 2017, at 11:27 AM, George King via swift-dev <swift-dev at swift.org> wrote:
>
> Hello, I’m curious about the swiftdoc format. I’ve looked through the swift codebase and have been unable to find either documentation about it or the relevant source code. Could somebody point me in the right direction? I’m thinking about building a swift documentation viewer and want to figure out if I would have to extract docs from source by hand, or if I can leverage the compiler in some way to do the parsing and document syntax rendering.
It’s a serialized format, emitted by Serialization::writeDocToStream(), here:
https://github.com/apple/swift/blob/master/lib/Serialization/Serialization.cpp#L4656-L4678
It would be a pain to write another client to read the binary format. Better would be to use SourceKit to walk the compiler’s AST and ask for the documentation for the various declarations.
- Doug
More information about the swift-dev
mailing list