11## Module ` Interfazzle `
22
3+ Interfazzle is a library for generating Markdown documentation from Swift symbol graphs. It handles the complete pipeline from validating Swift packages and building symbol graphs through the compiler, to parsing the resulting JSON files, organizing symbols by type hierarchy and dependencies, formatting Swift declarations, and generating clean interface-style Markdown documentation with optional README integration. The library is organized into Models (data structures for Config, SymbolGraph, and PackageDescription), Core (workflow components for validation, building, and extraction), and Generation (documentation formatting and output).
4+
35### Public interface
46
57``` swift
@@ -148,7 +150,7 @@ public struct MarkdownFormatter {
148150/// which modules are exposed as public products that should be documented.
149151public struct ModuleExtractor {
150152 /// Errors that can occur during module extraction.
151- public enum ExtractionError : Sendable , LocalizedError , Error {
153+ public enum ExtractionError : Sendable , Error , LocalizedError {
152154 /// A localized message describing what error occurred.
153155 public var errorDescription: String ? { get }
154156
@@ -174,7 +176,7 @@ public struct ModuleExtractor {
174176///
175177/// This struct is used to parse the JSON output from `swift package describe --type json`
176178/// and extract information about package targets and their file system locations.
177- public struct PackageDescription : Decodable , Encodable {
179+ public struct PackageDescription : Encodable , Decodable {
178180 /// Represents a build target within a Swift package.
179181 ///
180182 /// A target corresponds to a module that can be built as part of the package.
@@ -250,7 +252,7 @@ public struct PackageInfoLoader {
250252/// contains a valid Swift package before attempting to generate documentation.
251253public struct PackageValidator {
252254 /// Errors that can occur during package validation.
253- public enum ValidationError : Sendable , Error , LocalizedError {
255+ public enum ValidationError : LocalizedError , Error , Sendable {
254256 /// A localized message describing what error occurred.
255257 public var errorDescription: String ? { get }
256258
@@ -295,7 +297,7 @@ public struct SymbolGraph: Encodable, Decodable {
295297 ///
296298 /// This captures various types of relationships such as inheritance,
297299 /// conformance, membership, and other connections between symbols.
298- public struct Relationship : Decodable , Encodable {
300+ public struct Relationship : Encodable , Decodable {
299301 /// The kind of relationship.
300302 ///
301303 /// Examples include "inheritsFrom", "conformsTo", "memberOf", "overrideOf", etc.
@@ -324,12 +326,12 @@ public struct SymbolGraph: Encodable, Decodable {
324326 ///
325327 /// This is the core data structure that contains all information about a particular
326328 /// Swift symbol, including its declaration, documentation, and metadata.
327- public struct Symbol : Decodable , Encodable {
329+ public struct Symbol : Encodable , Decodable {
328330 /// Represents a fragment of a symbol's declaration.
329331 ///
330332 /// Declarations are broken down into fragments to allow for structured
331333 /// processing and formatting of symbol signatures.
332- public struct DeclarationFragment : Decodable , Encodable {
334+ public struct DeclarationFragment : Encodable , Decodable {
333335 /// The kind of declaration fragment.
334336 ///
335337 /// This indicates what type of token this fragment represents,
@@ -354,12 +356,12 @@ public struct SymbolGraph: Encodable, Decodable {
354356 ///
355357 /// This contains the structured documentation comments from the source code,
356358 /// broken down into individual lines for processing.
357- public struct DocComment : Decodable , Encodable {
359+ public struct DocComment : Encodable , Decodable {
358360 /// Represents a single line of documentation comment.
359361 ///
360362 /// Each line is stored separately to preserve formatting and allow
361363 /// for structured processing of documentation content.
362- public struct Line : Encodable , Decodable {
364+ public struct Line : Decodable , Encodable {
363365 /// The text content of this documentation line.
364366 ///
365367 /// This contains the actual comment text from the source code.
@@ -397,7 +399,7 @@ public struct SymbolGraph: Encodable, Decodable {
397399 ///
398400 /// This contains the parameter name and its type information
399401 /// as declaration fragments for structured processing.
400- public struct Parameter : Encodable , Decodable {
402+ public struct Parameter : Decodable , Encodable {
401403 /// Declaration fragments describing the parameter's type.
402404 ///
403405 /// This contains the type information and any modifiers for the parameter,
@@ -442,7 +444,7 @@ public struct SymbolGraph: Encodable, Decodable {
442444 ///
443445 /// This provides a way to uniquely reference symbols across different
444446 /// symbol graphs and within relationships.
445- public struct Identifier : Decodable , Encodable {
447+ public struct Identifier : Encodable , Decodable {
446448 /// The interface language for this symbol.
447449 ///
448450 /// For Swift symbols, this is typically "swift". This allows symbol graphs
@@ -492,7 +494,7 @@ public struct SymbolGraph: Encodable, Decodable {
492494 ///
493495 /// This includes the primary title and any subheading information
494496 /// that might be used for display purposes.
495- public struct Names : Decodable , Encodable {
497+ public struct Names : Encodable , Decodable {
496498 /// Optional subheading fragments for the symbol.
497499 ///
498500 /// This can contain additional type information or other context
@@ -621,4 +623,4 @@ public struct SymbolGraphBuilder {
621623}
622624```
623625
624- <!-- Generated by interfazzle.swift on 2025-10-29 12:20:38 +0100 -->
626+ <!-- Generated by interfazzle.swift on 2025-10-29 13:03:25 +0100 -->
0 commit comments