You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// - context: The context that the bundle is a part of.
28
28
/// - outputConsumer: The consumer that the conversion passes outputs of the conversion to.
29
+
/// - htmlContentConsumer: The consumer for HTML content that the conversion produces, or `nil` if the conversion shouldn't produce any HTML content.
29
30
/// - sourceRepository: The source repository where the documentation's sources are hosted.
30
31
/// - emitDigest: Whether the conversion should pass additional metadata output––such as linkable entities information, indexing information, or asset references by asset type––to the consumer.
31
32
/// - documentationCoverageOptions: The level of experimental documentation coverage information that the conversion should pass to the consumer.
32
33
/// - Returns: A list of problems that occurred during the conversion (excluding the problems that the context already encountered).
This source file is part of the Swift.org open source project
3
+
4
+
Copyright (c) 2025 Apple Inc. and the Swift project authors
5
+
Licensed under Apache License v2.0 with Runtime Library Exception
6
+
7
+
See https://swift.org/LICENSE.txt for license information
8
+
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9
+
*/
10
+
11
+
#if canImport(FoundationXML)
12
+
// TODO: Consider other HTML rendering options as a future improvement (rdar://165755530)
13
+
packageimport FoundationXML
14
+
#else
15
+
packageimport Foundation
16
+
#endif
17
+
18
+
/// A consumer for HTML content produced during documentation conversion.
19
+
packageprotocolHTMLContentConsumer{
20
+
// One reason that this is its own protocol, rather than an extension of ConvertOutputConsumer, is so that we can avoid exposing `XMLNode` in any public API.
21
+
// That way, we are completely free to replace the entire internal HTML rendering implementation with something else in the future, without breaking API.
22
+
23
+
/// Consumes the HTML content and metadata for a given page.
24
+
///
25
+
/// The content and metadata doesn't make up a full valid HTML page.
26
+
/// It's the consumers responsibility to insert the information into a template or skeletal structure to produce a valid HTML file for each page.
27
+
///
28
+
/// - Parameters:
29
+
/// - mainContent: The contents for this page as an XHTML node.
30
+
/// - metadata: Metadata information (title and description) about this page.
31
+
/// - reference: The resolved topic reference that identifies this page.
0 commit comments