Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SwiftDocC/Infrastructure/ConvertActionConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ package enum ConvertActionConverter {
}

if emitDigest {
let nodeLinkSummaries = entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode, includeTaskGroups: true)
let nodeLinkSummaries = entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode)
let nodeIndexingRecords = try renderNode.indexingRecords(onPage: identifier)

resultsGroup.async(queue: resultsSyncQueue) {
Expand All @@ -159,7 +159,7 @@ package enum ConvertActionConverter {
indexingRecords.append(contentsOf: nodeIndexingRecords)
}
} else if FeatureFlags.current.isExperimentalLinkHierarchySerializationEnabled {
let nodeLinkSummaries = entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode, includeTaskGroups: false)
let nodeLinkSummaries = entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode)

resultsGroup.async(queue: resultsSyncQueue) {
linkSummaries.append(contentsOf: nodeLinkSummaries)
Expand Down
123 changes: 75 additions & 48 deletions Sources/SwiftDocC/LinkTargets/LinkDestinationSummary.swift

Large diffs are not rendered by default.

32 changes: 1 addition & 31 deletions Sources/SwiftDocC/SwiftDocC.docc/Resources/LinkableEntities.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.0",
"info": {
"description": "Specification of the DocC linkable-entities.json digest file.",
"version": "0.3.0",
"version": "0.3.1",
"title": "Linkable Entities"
},
"paths": { },
Expand Down Expand Up @@ -59,12 +59,6 @@
"$ref": "#/components/schemas/PlatformAvailability"
}
},
"taskGroups": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskGroup"
}
},
"usr": {
"type": "string"
},
Expand Down Expand Up @@ -184,13 +178,6 @@
"$ref": "#/components/schemas/DeclarationToken"
},
"nullable": true
},
"taskGroups": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskGroup"
},
"nullable": true
}
}
},
Expand Down Expand Up @@ -517,23 +504,6 @@
}
}
},
"TaskGroup": {
"type": "object",
"required": [
"identifiers"
],
"properties": {
"title": {
"type": "string"
},
"identifiers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"DeclarationToken": {
"required": [
"text",
Expand Down
30 changes: 1 addition & 29 deletions Tests/DocCCommandLineTests/ConvertActionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1003,11 +1003,6 @@ class ConvertActionTests: XCTestCase {
title: "TestBed",
language: .swift,
abstract: "TestBed abstract.",
taskGroups: [
.init(title: "Basics", identifiers: ["doc://com.test.example/documentation/TestBundle/Article"]),
.init(title: "Articles", identifiers: ["doc://com.test.example/documentation/TestBundle/SampleArticle"]),
.init(title: "Structures", identifiers: ["doc://com.test.example/documentation/TestBed/A"]),
],
usr: "TestBed",
availableLanguages: [.swift],
platforms: nil,
Expand All @@ -1025,7 +1020,6 @@ class ConvertActionTests: XCTestCase {
title: "A",
language: .swift,
abstract: "An abstract.",
taskGroups: [],
usr: "s:7TestBed1AV",
availableLanguages: [.swift],
platforms: nil,
Expand All @@ -1043,7 +1037,6 @@ class ConvertActionTests: XCTestCase {
title: "This is an article",
language: .swift,
abstract: "Article abstract.",
taskGroups: [],
availableLanguages: [.swift],
platforms: nil,
topicImages: nil,
Expand All @@ -1060,7 +1053,6 @@ class ConvertActionTests: XCTestCase {
title: "Sample Article",
language: .swift,
abstract: "Sample abstract.",
taskGroups: [],
availableLanguages: [.swift],
platforms: nil,
topicImages: nil,
Expand Down Expand Up @@ -1161,22 +1153,7 @@ class ConvertActionTests: XCTestCase {
}

// Rather than comparing all the linkable entities in the file, pull out one overload group
// and check its task groups
let overloadGroupEntity = try XCTUnwrap(resultLikableEntities.first(where: { $0.usr == "s:8ShapeKit18OverloadedProtocolP20fourthTestMemberName4testSdSS_tF::OverloadGroup" }))

let taskGroups = try XCTUnwrap(overloadGroupEntity.taskGroups)
guard taskGroups.count == 1, let overloadTaskGroup = taskGroups.first else {
XCTFail("Expected one task group, found \(taskGroups.count): \(taskGroups.map(\.title?.singleQuoted))")
return
}

XCTAssertEqual(overloadTaskGroup.title, "Overloads")
XCTAssertEqual(Set(overloadTaskGroup.identifiers), [
"doc://com.shapes.ShapeKit/documentation/ShapeKit/OverloadedProtocol/fourthTestMemberName(test:)-91hxs",
"doc://com.shapes.ShapeKit/documentation/ShapeKit/OverloadedProtocol/fourthTestMemberName(test:)-961zx",
"doc://com.shapes.ShapeKit/documentation/ShapeKit/OverloadedProtocol/fourthTestMemberName(test:)-8iuz7",
"doc://com.shapes.ShapeKit/documentation/ShapeKit/OverloadedProtocol/fourthTestMemberName(test:)-1h173",
])
XCTAssertTrue(resultLikableEntities.contains(where: { $0.usr == "s:8ShapeKit18OverloadedProtocolP20fourthTestMemberName4testSdSS_tF::OverloadGroup" }))
}

func testDownloadMetadataIsWrittenToOutputFolder() async throws {
Expand Down Expand Up @@ -1407,7 +1384,6 @@ class ConvertActionTests: XCTestCase {
title: "Making an Augmented Reality App",
language: .swift,
abstract: "This is an abstract for the intro.",
taskGroups: [.init(title: nil, identifiers: [reference.withFragment("Section-Name").absoluteString])],
availableLanguages: [.swift],
platforms: nil,
topicImages: nil,
Expand All @@ -1421,7 +1397,6 @@ class ConvertActionTests: XCTestCase {
title: "Section Name",
language: .swift,
abstract: nil,
taskGroups: [],
availableLanguages: [.swift],
platforms: nil,
topicImages: nil,
Expand All @@ -1438,7 +1413,6 @@ class ConvertActionTests: XCTestCase {
title: "Technology X",
language: .swift,
abstract: "Learn about some stuff in Technology X.",
taskGroups: [.init(title: nil, identifiers: [reference.appendingPath("Volume-1").absoluteString])],
availableLanguages: [.swift],
platforms: nil,
topicImages: nil,
Expand Down Expand Up @@ -3199,7 +3173,6 @@ private extension LinkDestinationSummary {
title: String,
language: SourceLanguage,
abstract: String?,
taskGroups: [TaskGroup],
usr: String? = nil,
availableLanguages: Set<SourceLanguage>,
platforms: [PlatformAvailability]?,
Expand All @@ -3216,7 +3189,6 @@ private extension LinkDestinationSummary {
abstract: abstract.map { [.text($0)] },
availableLanguages: availableLanguages,
platforms: platforms,
taskGroups: taskGroups,
usr: usr,
subheadingDeclarationFragments: nil,
redirects: redirects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5534,7 +5534,7 @@ let expected = """
let entity = try context.entity(with: reference)
let renderNode = try XCTUnwrap(converter.convert(entity))

return entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode, includeTaskGroups: false)
return entity.externallyLinkableElementSummaries(context: context, renderNode: renderNode)
}
let linkResolutionInformation = try context.linkResolver.localResolver.prepareForSerialization(bundleID: context.inputs.id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ class ExternalPathHierarchyResolverTests: XCTestCase {
let entity = try dependencyContext.entity(with: reference)
let renderNode = try XCTUnwrap(dependencyConverter.renderNode(for: entity))

return entity.externallyLinkableElementSummaries(context: dependencyContext, renderNode: renderNode, includeTaskGroups: false)
return entity.externallyLinkableElementSummaries(context: dependencyContext, renderNode: renderNode)
}
let linkResolutionInformation = try dependencyContext.linkResolver.localResolver.prepareForSerialization(bundleID: dependencyContext.inputs.id)

Expand Down Expand Up @@ -1004,7 +1004,7 @@ class ExternalPathHierarchyResolverTests: XCTestCase {
for reference in context.knownPages {
let node = try context.entity(with: reference)
let renderNode = converter.convert(node)
entitySummaries.append(contentsOf: node.externallyLinkableElementSummaries(context: context, renderNode: renderNode, includeTaskGroups: false))
entitySummaries.append(contentsOf: node.externallyLinkableElementSummaries(context: context, renderNode: renderNode))
}

let externalResolver = ExternalPathHierarchyResolver(
Expand Down
Loading