Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 6c38f14

Browse files
committed
Update dependencies
Fix CommonMark version specifier
1 parent 962bb76 commit 6c38f14

File tree

6 files changed

+48
-41
lines changed

6 files changed

+48
-41
lines changed

Package.resolved

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ let package = Package(
1414
],
1515
dependencies: [
1616
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .revision("0.50300.0")),
17-
.package(url: "https://github.com/SwiftDocOrg/SwiftSemantics.git", .upToNextMinor(from: "0.1.0")),
18-
.package(url: "https://github.com/SwiftDocOrg/CommonMark.git", .upToNextMinor(from: "0.4.0")),
19-
.package(url: "https://github.com/SwiftDocOrg/SwiftMarkup.git", .upToNextMinor(from: "0.2.1")),
20-
.package(url: "https://github.com/SwiftDocOrg/GraphViz.git", .upToNextMinor(from: "0.3.0")),
17+
.package(url: "https://github.com/SwiftDocOrg/SwiftSemantics.git", .upToNextMinor(from: "0.3.0")),
18+
.package(url: "https://github.com/SwiftDocOrg/CommonMark.git", .upToNextMinor(from: "0.5.0")),
19+
.package(url: "https://github.com/SwiftDocOrg/SwiftMarkup.git", .upToNextMinor(from: "0.3.0")),
20+
.package(url: "https://github.com/SwiftDocOrg/GraphViz.git", .upToNextMinor(from: "0.4.0")),
2121
.package(url: "https://github.com/NSHipster/HypertextLiteral.git", .upToNextMinor(from: "0.0.2")),
2222
.package(url: "https://github.com/SwiftDocOrg/Markup.git", .upToNextMinor(from: "0.0.3")),
23-
.package(url: "https://github.com/NSHipster/SwiftSyntaxHighlighter.git", .revision("1.1.3")),
23+
.package(url: "https://github.com/NSHipster/SwiftSyntaxHighlighter.git", .revision("1.2.2")),
2424
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.1")),
2525
.package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.4.2")),
2626
.package(name: "LoggingGitHubActions", url: "https://github.com/NSHipster/swift-log-github-actions.git", .upToNextMinor(from: "0.0.1")),

Sources/swift-doc/Supporting Types/Components/Abstract.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct Abstract: Component {
4848
</a>
4949
</dt>
5050
<dd>
51-
\#(commonmark: symbol.documentation?.summary ?? "")
51+
\#(commonmark: symbol.documentation?.summary?.description ?? "")
5252
</dd>
5353
"""#
5454
}

Sources/swift-doc/Supporting Types/Components/Documentation.swift

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct Documentation: Component {
3636
}
3737

3838
if documentation.summary != nil {
39-
Fragment { "\(documentation.summary!.escapingEmojiShortcodes)" }
39+
Fragment { "\(documentation.summary!.description.escapingEmojiShortcodes)" }
4040
}
4141

4242
Declaration(of: symbol, in: module, baseURL: baseURL)
@@ -49,22 +49,22 @@ struct Documentation: Component {
4949
Section {
5050
Heading { "Parameters" }
5151
List(of: documentation.parameters) { parameter in
52-
Fragment { "\(parameter.name): \(parameter.content)" }
52+
Fragment { "\(parameter.name): \(parameter.content.description)" }
5353
}
5454
}
5555
}
5656

5757
if documentation.throws != nil {
5858
Section {
5959
Heading { "Throws" }
60-
Fragment { documentation.throws!.escapingEmojiShortcodes }
60+
Fragment { documentation.throws!.description.escapingEmojiShortcodes }
6161
}
6262
}
6363

6464
if documentation.returns != nil {
6565
Section {
6666
Heading { "Returns" }
67-
Fragment { documentation.returns!.escapingEmojiShortcodes }
67+
Fragment { documentation.returns!.description.escapingEmojiShortcodes }
6868
}
6969
}
7070

@@ -90,7 +90,7 @@ struct Documentation: Component {
9090
if let summary = documentation.summary {
9191
fragments.append(#"""
9292
<div class="summary" role="doc-abstract">
93-
\#(commonmark: summary)
93+
\#(commonmark: summary.description)
9494
</div>
9595
"""# as HypertextLiteral.HTML)
9696
}
@@ -119,7 +119,7 @@ struct Documentation: Component {
119119
type = nil
120120
}
121121

122-
return (entry.name, type, entry.content)
122+
return (entry.name, type, entry.content.description)
123123
}
124124

125125
fragments.append(#"""
@@ -158,14 +158,14 @@ struct Documentation: Component {
158158
if let `throws` = documentation.throws {
159159
fragments.append(#"""
160160
<h4>Throws</h4>
161-
\#(commonmark: `throws`)
161+
\#(commonmark: `throws`.description)
162162
"""# as HypertextLiteral.HTML)
163163
}
164164
165165
if let `returns` = documentation.returns {
166166
fragments.append(#"""
167167
<h4>Returns</h4>
168-
\#(commonmark: `returns`)
168+
\#(commonmark: `returns`.description)
169169
"""# as HypertextLiteral.HTML)
170170
}
171171

@@ -223,6 +223,10 @@ extension Documentation {
223223
return Fragment {
224224
paragraph.render(format: .commonmark)
225225
}
226+
case .thematicBreak(let thematicBreak):
227+
return Fragment {
228+
thematicBreak.render(format: .commonmark)
229+
}
226230
}
227231
}
228232

@@ -257,6 +261,9 @@ extension Documentation {
257261
return HTML(list.render(format: .html, options: [.unsafe]))
258262
case .paragraph(let paragraph):
259263
return HTML(paragraph.render(format: .html, options: [.unsafe]))
264+
case .thematicBreak(let thematicBreak):
265+
return HTML(thematicBreak.render(format: .html, options: [.unsafe]))
266+
260267
}
261268
}
262269
}

Sources/swift-doc/Supporting Types/Components/Relationships.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct Relationships: Component {
125125
} else {
126126
return #"""
127127
<dt class="\#(descriptor)"><code><a href="\#(path(for: symbol, with: baseURL))">\#(symbol.id)</a></code></dt>
128-
<dd>\#(commonmark: symbol.documentation?.summary ?? "")</dd>
128+
<dd>\#(commonmark: symbol.documentation?.summary?.description ?? "")</dd>
129129
"""#
130130
}
131131
})

Tests/SwiftDocTests/SourceFileTests.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ final class SourceFileTests: XCTestCase {
6565
do {
6666
let `protocol` = sourceFile.symbols[0]
6767
XCTAssert(`protocol`.api is Protocol)
68-
XCTAssertEqual(`protocol`.documentation?.summary, "Protocol")
68+
XCTAssertEqual(`protocol`.documentation?.summary?.description, "Protocol")
6969

7070
do {
7171
let function = sourceFile.symbols[1]
@@ -76,7 +76,7 @@ final class SourceFileTests: XCTestCase {
7676
XCTAssert(function.context.first is Symbol)
7777
XCTAssertEqual(function.context.first as? Symbol, `protocol`)
7878

79-
XCTAssertEqual(function.documentation?.summary, "Function requirement")
79+
XCTAssertEqual(function.documentation?.summary?.description, "Function requirement")
8080
}
8181

8282
do {
@@ -88,14 +88,14 @@ final class SourceFileTests: XCTestCase {
8888
XCTAssert(property.context.first is Symbol)
8989
XCTAssertEqual(property.context.first as? Symbol, `protocol`)
9090

91-
XCTAssertEqual(property.documentation?.summary, "Property requirement")
91+
XCTAssertEqual(property.documentation?.summary?.description, "Property requirement")
9292
}
9393
}
9494

9595
do {
9696
let enumeration = sourceFile.symbols[3]
9797
XCTAssert(enumeration.api is Enumeration)
98-
XCTAssertEqual(enumeration.documentation?.summary, "Enumeration")
98+
XCTAssertEqual(enumeration.documentation?.summary?.description, "Enumeration")
9999

100100
do {
101101
let `case` = sourceFile.symbols[4]
@@ -106,14 +106,14 @@ final class SourceFileTests: XCTestCase {
106106
XCTAssert(`case`.context.first is Symbol)
107107
XCTAssertEqual(`case`.context.first as? Symbol, enumeration)
108108

109-
XCTAssertEqual(`case`.documentation?.summary, "Enumeration case")
109+
XCTAssertEqual(`case`.documentation?.summary?.description, "Enumeration case")
110110
}
111111
}
112112

113113
do {
114114
let structure = sourceFile.symbols[5]
115115
XCTAssert(structure.api is Structure)
116-
XCTAssertEqual(structure.documentation?.summary, "Structure")
116+
XCTAssertEqual(structure.documentation?.summary?.description, "Structure")
117117
}
118118

119119
do {
@@ -126,7 +126,7 @@ final class SourceFileTests: XCTestCase {
126126
XCTAssert(function.context.first is Extension)
127127
XCTAssertEqual((function.context.first as? Extension)?.extendedType, "S")
128128

129-
XCTAssertEqual(function.documentation?.summary, "Function")
129+
XCTAssertEqual(function.documentation?.summary?.description, "Function")
130130
}
131131

132132
do {
@@ -138,14 +138,14 @@ final class SourceFileTests: XCTestCase {
138138
XCTAssert(property.context.first is Extension)
139139
XCTAssertEqual((property.context.first as? Extension)?.extendedType, "S")
140140

141-
XCTAssertEqual(property.documentation?.summary, "Property")
141+
XCTAssertEqual(property.documentation?.summary?.description, "Property")
142142
}
143143
}
144144

145145
do {
146146
let `class` = sourceFile.symbols[8]
147147
XCTAssert(`class`.api is Class)
148-
XCTAssertEqual(`class`.documentation?.summary, "Class")
148+
XCTAssertEqual(`class`.documentation?.summary?.description, "Class")
149149

150150
do {
151151
let function = sourceFile.symbols[9]
@@ -156,7 +156,7 @@ final class SourceFileTests: XCTestCase {
156156
XCTAssert(function.context.first is Symbol)
157157
XCTAssertEqual(function.context.first as? Symbol, `class`)
158158

159-
XCTAssertEqual(function.documentation?.summary, "Function")
159+
XCTAssertEqual(function.documentation?.summary?.description, "Function")
160160
}
161161

162162
do {
@@ -168,15 +168,15 @@ final class SourceFileTests: XCTestCase {
168168
XCTAssert(property.context.first is Symbol)
169169
XCTAssertEqual(property.context.first as? Symbol, `class`)
170170

171-
XCTAssertEqual(property.documentation?.summary, "Property")
171+
XCTAssertEqual(property.documentation?.summary?.description, "Property")
172172
}
173173
}
174174

175175
do {
176176
let `class` = sourceFile.symbols[11]
177177
XCTAssert(`class`.api is Class)
178178
XCTAssertEqual((`class`.api as? Class)?.inheritance, ["C"])
179-
XCTAssertEqual(`class`.documentation?.summary, "Subclass")
179+
XCTAssertEqual(`class`.documentation?.summary?.description, "Subclass")
180180
}
181181
}
182182
}

0 commit comments

Comments
 (0)