Documentation with DocC

DocC builds rich documentation from comments plus a .docc catalog (articles, tutorials, images). Build it in Xcode (Product → Build Documentation) or with swift package generate-documentation. Host it statically (GitHub Pages) or on the Swift Package Index.

Symbol links use double backticks (`` TypeName/method(_:) `). Callouts: - Note:, - Warning:, - Important:, - Tip:`.

/// A thread-safe cache for downloaded images.
///
/// Use ``ImageCache`` to avoid re-downloading images:
///
/// ```swift
/// let image = try await ImageCache.shared.image(for: url)
/// ```
///
/// - Important: Images are evicted when memory is low.
public actor ImageCache {
    /// Returns the image at `url`, downloading it if needed.
    /// - Parameter url: The remote image URL.
    /// - Returns: The decoded image.
    /// - Throws: ``CacheError/downloadFailed`` if the request fails.
    public func image(for url: URL) async throws -> Image { fatalError() }
}