Documentation Language: Swift

Framework

DocCStatic Library

Generate static HTML/CSS documentation from Swift packages.

Overview

swift-docc-static generates pure HTML/CSS documentation from Swift packages, combining the symbol graph processing of Swift-DocC with a static output approach. The generated documentation works locally as file:// URLs and can be hosted on any web server without requiring JavaScript for basic navigation.

This package provides:

Key Features

Quick Start

Create a generator with your configuration, then call generate():

let configuration = Configuration(
    packageDirectory: URL(fileURLWithPath: "/path/to/package"),
    outputDirectory: URL(fileURLWithPath: "/path/to/docs"),
    includeSearch: true
)
let generator = StaticDocumentationGenerator(configuration: configuration)
let result = try await generator.generate()
print("Generated \(result.generatedPages) pages")

Topics

Essentials

A
Getting Started with DocCStatic

Use the DocCStatic library to generate static documentation programmatically.

Guides

A
Configuration Reference

Configure DocCStatic for your documentation needs.

A
Cross-Package Linking

Understand how DocCStatic handles links between packages.

A
Custom Themes

Customise the appearance of your documentation.

Library API

A
Configuration Reference

Configure DocCStatic for your documentation needs.

S
StaticDocumentationGenerator

The main orchestrator for generating static HTML documentation.

S
GenerationResult

The result of a documentation generation operation.

E
GenerationError

Errors that can occur during documentation generation.

Rendering

S
HTMLPageBuilder

Builds complete HTML pages from render nodes.

S
RenderContentHTMLRenderer

Renders DocC render content to HTML.

S
IndexPageBuilder

Builds a combined index page listing all documented modules.

C
StaticHTMLConsumer

A consumer that writes documentation to static HTML files.

Search

S
SearchIndexBuilder

Builds a search index for client-side documentation search.

Supporting Types

E
DependencyInclusionPolicy

Policy for including dependency documentation in the generated output.

S
ThemeConfiguration

Configuration for the documentation theme.

S
Warning

A warning generated during documentation generation.

S
SourceLocation

A location in source code.

Structures

S
DocLinkPostProcessor

Post-processes generated HTML to resolve doc:// URLs into proper links.

S
NavigationIndex

Represents the navigation index for documentation.

S
NavigationNode

A node in the navigation tree.

S
NavigationSidebarBuilder

Builds the navigation sidebar HTML from a navigation index.

S
SwiftSyntaxHighlighter

A simple Swift syntax highlighter for static HTML output.

S
SymbolKind

A symbol kind for documentation display, wrapping DocumentationNode.Kind.

Enumerations

E
NodeType

The type of a navigation node.