Skip to content

Commit 13d5c18

Browse files
committed
rdar://147920933 (Support HeaderDoc tag)
1 parent 94eaaa3 commit 13d5c18

File tree

4 files changed

+29
-23
lines changed

4 files changed

+29
-23
lines changed

Package.resolved

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/apple/swift-argument-parser.git",
77
"state" : {
8-
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
9-
"version" : "1.4.0"
8+
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
9+
"version" : "1.5.0"
1010
}
1111
},
1212
{
1313
"identity" : "swift-asn1",
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/apple/swift-asn1.git",
1616
"state" : {
17-
"revision" : "7faebca1ea4f9aaf0cda1cef7c43aecd2311ddf6",
18-
"version" : "1.3.0"
17+
"revision" : "a54383ada6cecde007d374f58f864e29370ba5c3",
18+
"version" : "1.3.2"
1919
}
2020
},
2121
{
@@ -33,34 +33,34 @@
3333
"location" : "https://github.com/swiftlang/swift-cmark.git",
3434
"state" : {
3535
"branch" : "gfm",
36-
"revision" : "2c47322cb32cbed555f13bf5cbfaa488cc30a785"
36+
"revision" : "b97d09472e847a416629f026eceae0e2afcfad65"
3737
}
3838
},
3939
{
4040
"identity" : "swift-collections",
4141
"kind" : "remoteSourceControl",
4242
"location" : "https://github.com/apple/swift-collections.git",
4343
"state" : {
44-
"revision" : "3d2dc41a01f9e49d84f0a3925fb858bed64f702d",
45-
"version" : "1.1.2"
44+
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
45+
"version" : "1.1.4"
4646
}
4747
},
4848
{
4949
"identity" : "swift-crypto",
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/apple/swift-crypto.git",
5252
"state" : {
53-
"revision" : "06dc63c6d8da54ee11ceb268cde1fa68161afc96",
54-
"version" : "3.9.1"
53+
"revision" : "e8d6eba1fef23ae5b359c46b03f7d94be2f41fed",
54+
"version" : "3.12.3"
5555
}
5656
},
5757
{
5858
"identity" : "swift-docc-plugin",
5959
"kind" : "remoteSourceControl",
6060
"location" : "https://github.com/swiftlang/swift-docc-plugin.git",
6161
"state" : {
62-
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
63-
"version" : "1.3.0"
62+
"revision" : "85e4bb4e1cd62cec64a4b8e769dcefdf0c5b9d64",
63+
"version" : "1.4.3"
6464
}
6565
},
6666
{
@@ -69,7 +69,7 @@
6969
"location" : "https://github.com/swiftlang/swift-docc-symbolkit.git",
7070
"state" : {
7171
"branch" : "main",
72-
"revision" : "96bce1cfad4f4d7e265c1eb46729ebf8a7695f4b"
72+
"revision" : "ddacb655e2087fd722cb5ca2bcc49953ee267e37"
7373
}
7474
},
7575
{
@@ -78,34 +78,34 @@
7878
"location" : "https://github.com/swiftlang/swift-lmdb.git",
7979
"state" : {
8080
"branch" : "main",
81-
"revision" : "c42582487fe84f72a4d417dd2d8493757bd4d072"
81+
"revision" : "1ad9a2d80b6fcde498c2242f509bd1be7d667ff8"
8282
}
8383
},
8484
{
8585
"identity" : "swift-markdown",
8686
"kind" : "remoteSourceControl",
87-
"location" : "https://github.com/swiftlang/swift-markdown.git",
87+
"location" : "https://github.com/binamaniar/swift-markdown.git",
8888
"state" : {
89-
"branch" : "main",
90-
"revision" : "d21714073e0d16ba78eebdf36724863afc36871d"
89+
"branch" : "support_abstract_headerdoc",
90+
"revision" : "3d4d4196d9e1f3acc216755c542e71430f752984"
9191
}
9292
},
9393
{
9494
"identity" : "swift-nio",
9595
"kind" : "remoteSourceControl",
9696
"location" : "https://github.com/apple/swift-nio.git",
9797
"state" : {
98-
"revision" : "fc79798d5a150d61361a27ce0c51169b889e23de",
99-
"version" : "2.68.0"
98+
"revision" : "0f54d58bb5db9e064f332e8524150de379d1e51c",
99+
"version" : "2.82.1"
100100
}
101101
},
102102
{
103103
"identity" : "swift-system",
104104
"kind" : "remoteSourceControl",
105105
"location" : "https://github.com/apple/swift-system.git",
106106
"state" : {
107-
"revision" : "6a9e38e7bd22a3b8ba80bddf395623cf68f57807",
108-
"version" : "1.3.1"
107+
"revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1",
108+
"version" : "1.4.2"
109109
}
110110
}
111111
],

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
134134
// Building standalone, so fetch all dependencies remotely.
135135
package.dependencies += [
136136
.package(url: "https://github.com/apple/swift-nio.git", from: "2.53.0"),
137-
.package(url: "https://github.com/swiftlang/swift-markdown.git", branch: "main"),
137+
.package(url: "https://github.com/binamaniar/swift-markdown.git", branch: "support_abstract_headerdoc"),
138138
.package(url: "https://github.com/swiftlang/swift-lmdb.git", branch: "main"),
139139
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.2"),
140140
.package(url: "https://github.com/swiftlang/swift-docc-symbolkit.git", branch: "main"),

Sources/SwiftDocC/Model/Rendering/RenderContentCompiler.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ struct RenderContentCompiler: MarkupVisitor {
359359
return renderableDirective.render(blockDirective, with: &self)
360360
}
361361

362+
mutating func visitDoxygenAbstract(_ doxygenAbstract: DoxygenAbstract) -> [any RenderContent] {
363+
doxygenAbstract.children.flatMap { self.visit($0)}
364+
}
365+
362366
mutating func visitDoxygenDiscussion(_ doxygenDiscussion: DoxygenDiscussion) -> [any RenderContent] {
363367
doxygenDiscussion.children.flatMap { self.visit($0) }
364368
}

Tests/SwiftDocCTests/Semantics/DoxygenTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class DoxygenTests: XCTestCase {
1919
func testDoxygenDiscussionAndNote() throws {
2020
let documentationLines: [SymbolGraph.LineList.Line] = """
2121
This is an abstract.
22+
@abstract This is description with abstract.
2223
2324
@discussion This is a discussion linking to ``AnotherClass`` and ``AnotherClass/prop``.
2425
@@ -96,6 +97,7 @@ class DoxygenTests: XCTestCase {
9697

9798
XCTAssertEqual(symbol.abstract?.format(), "This is an abstract.")
9899
XCTAssertEqual(symbol.discussion?.content.map { $0.format() }, [
100+
#"\abstract This is description with abstract."#,
99101
#"\discussion This is a discussion linking to ``doc://unit-test/documentation/ModuleName/AnotherClass`` and ``doc://unit-test/documentation/ModuleName/AnotherClass/prop``."#,
100102
#"\note This is a note linking to ``doc://unit-test/documentation/ModuleName/Class3`` and ``Class3/prop2``."#
101103
])
@@ -108,10 +110,10 @@ class DoxygenTests: XCTestCase {
108110
XCTAssertEqual(renderNode.primaryContentSections.count, 1)
109111

110112
let overviewSection = try XCTUnwrap(renderNode.primaryContentSections.first as? ContentRenderSection)
111-
XCTAssertEqual(overviewSection.content.count, 3)
113+
XCTAssertEqual(overviewSection.content.count, 4)
112114
XCTAssertEqual(overviewSection.content, [
113115
.heading(.init(level: 2, text: "Overview", anchor: "overview")),
114-
116+
.paragraph(.init(inlineContent: [.text("This is description with abstract.")])),
115117
.paragraph(.init(inlineContent: [
116118
.text("This is a discussion linking to "),
117119
.reference(

0 commit comments

Comments
 (0)