docc2json is a specialized tool designed to parse Apple's DocC JSON documentation output and convert it into a clean, structured JSON schema. Its main purpose is to transform Xcode-built documentation into a web-friendly format that can be hosted and rendered by custom frontends, making iOS SDK documentation accessible outside of Xcode.
The tool offers comprehensive documentation extraction including abstracts, discussions, examples, and code listings from DocC comments. It features fast parallel processing of JSON files, filters by access level with an optional public-only flag, and extracts rich metadata including parameters, return types, and async/throws modifiers. Additional capabilities include cross-reference resolution for type relationships, automatic protocol unmangling that converts mangled Swift protocol names to clean names, smart conformance filtering that excludes stdlib protocols while keeping custom ones, flexible grouping options by prefix or custom configuration, and support for including documentation articles and tutorials.
docc2json works through a multi-step process: it first walks through and collects all JSON files in the DocC output, then parses them concurrently using goroutines. It reconstructs method signatures from DocC's token arrays, resolves cross-references between symbols, filters symbols based on access level if specified, transforms the DocC schema to a custom SDK schema, and finally writes formatted JSON output. The tool automatically processes protocol conformances with smart filtering and supports both automatic prefix-based grouping and custom YAML configuration for organizing types.
The primary benefits include enabling documentation websites to display iOS SDK documentation, providing IDE integration capabilities for autocomplete and inline docs, supporting SDK analysis through programmatic access to structure, and generating cross-platform documentation. It has been tested with AppGramSDK documentation containing 38,618 files and 129 symbols plus 92 articles, demonstrating performance of less than 1 second for parsing and transformation.
docc2json targets iOS developers, SDK creators, documentation engineers, and teams needing to publish Apple framework documentation online. It integrates with Xcode's DocC output and supports Swift 5.9+ DocC schema version 0.3.0, requiring Go 1.21 or higher and DocC generated documentation (.doccarchive or processed docs/ folder).
admin
docc2json is designed for iOS developers, SDK creators, documentation engineers, and development teams who need to publish Apple framework documentation online. It targets users working with Xcode-built DocC documentation who require web-friendly JSON output for custom documentation sites, IDE tooling integration, or SDK analysis. The tool is particularly useful for teams building documentation portals, creating developer experiences around iOS SDKs, or needing to analyze and transform Swift documentation structures.