Skip to content

Commit db163a1

Browse files
authored
Revert "Minimally integrate per-page HTML content into each "index.html" file…" (#1392)
This reverts commit 8b49f1b.
1 parent 59175af commit db163a1

16 files changed

+39
-900
lines changed

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ let package = Package(
4444
name: "SwiftDocC",
4545
dependencies: [
4646
.target(name: "DocCCommon"),
47-
.target(name: "DocCHTML"),
4847
.product(name: "Markdown", package: "swift-markdown"),
4948
.product(name: "SymbolKit", package: "swift-docc-symbolkit"),
5049
.product(name: "CLMDB", package: "swift-lmdb"),

Sources/SwiftDocC/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ add_library(SwiftDocC
175175
Model/Rendering/Diffing/Differences.swift
176176
Model/Rendering/Diffing/RenderNode+Diffable.swift
177177
Model/Rendering/DocumentationContentRenderer.swift
178-
Model/Rendering/HTML/HTMLContentConsumer.swift
179-
Model/Rendering/HTML/HTMLRenderer.swift
180178
Model/Rendering/LinkTitleResolver.swift
181179
"Model/Rendering/Navigation Tree/RenderHierarchy.swift"
182180
"Model/Rendering/Navigation Tree/RenderHierarchyChapter.swift"
@@ -467,8 +465,6 @@ add_library(SwiftDocC
467465
Utility/Version.swift)
468466
target_link_libraries(SwiftDocC PRIVATE
469467
DocCCommon)
470-
target_link_libraries(SwiftDocC PRIVATE
471-
DocCHTML)
472468
target_link_libraries(SwiftDocC PUBLIC
473469
SwiftMarkdown::Markdown
474470
DocC::SymbolKit

Sources/SwiftDocC/Infrastructure/ConvertActionConverter.swift

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ package enum ConvertActionConverter {
2626
/// - Parameters:
2727
/// - context: The context that the bundle is a part of.
2828
/// - 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.
3029
/// - sourceRepository: The source repository where the documentation's sources are hosted.
3130
/// - 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.
3231
/// - documentationCoverageOptions: The level of experimental documentation coverage information that the conversion should pass to the consumer.
3332
/// - Returns: A list of problems that occurred during the conversion (excluding the problems that the context already encountered).
3433
package static func convert(
3534
context: DocumentationContext,
3635
outputConsumer: some ConvertOutputConsumer & ExternalNodeConsumer,
37-
htmlContentConsumer: (any HTMLContentConsumer)?,
3836
sourceRepository: SourceRepository?,
3937
emitDigest: Bool,
4038
documentationCoverageOptions: DocumentationCoverageOptions
@@ -105,27 +103,15 @@ package enum ConvertActionConverter {
105103

106104
let renderSignpostHandle = signposter.beginInterval("Render", id: signposter.makeSignpostID(), "Render \(context.knownPages.count) pages")
107105

108-
var conversionProblems: [Problem] = context.knownPages.concurrentPerform { [htmlContentConsumer] identifier, results in
106+
var conversionProblems: [Problem] = context.knownPages.concurrentPerform { identifier, results in
109107
// If cancelled skip all concurrent conversion work in this block.
110108
guard !Task.isCancelled else { return }
111109

112110
// Wrap JSON encoding in an autorelease pool to avoid retaining the autoreleased ObjC objects returned by `JSONSerialization`
113111
autoreleasepool {
114112
do {
115113
let entity = try context.entity(with: identifier)
116-
117-
if let htmlContentConsumer {
118-
var renderer = HTMLRenderer(reference: identifier, context: context, goal: .conciseness)
119-
120-
if let symbol = entity.semantic as? Symbol {
121-
let renderedPageInfo = renderer.renderSymbol(symbol)
122-
try htmlContentConsumer.consume(pageInfo: renderedPageInfo, forPage: identifier)
123-
} else if let article = entity.semantic as? Article {
124-
let renderedPageInfo = renderer.renderArticle(article)
125-
try htmlContentConsumer.consume(pageInfo: renderedPageInfo, forPage: identifier)
126-
}
127-
}
128-
114+
129115
guard let renderNode = converter.renderNode(for: entity) else {
130116
// No render node was produced for this entity, so just skip it.
131117
return
@@ -261,16 +247,3 @@ package enum ConvertActionConverter {
261247
return conversionProblems
262248
}
263249
}
264-
265-
private extension HTMLContentConsumer {
266-
func consume(pageInfo: HTMLRenderer.RenderedPageInfo, forPage reference: ResolvedTopicReference) throws {
267-
try consume(
268-
mainContent: pageInfo.content,
269-
metadata: (
270-
title: pageInfo.metadata.title,
271-
description: pageInfo.metadata.plainDescription
272-
),
273-
forPage: reference
274-
)
275-
}
276-
}

Sources/SwiftDocC/Infrastructure/ConvertOutputConsumer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
99
*/
1010

11+
import Foundation
12+
1113
/// A consumer for output produced by a documentation conversion.
1214
///
1315
/// Types that conform to this protocol manage what to do with documentation conversion products, for example persist them to disk

Sources/SwiftDocC/Model/Rendering/HTML/HTMLContentConsumer.swift

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)