Skip to content

Commit 758f91e

Browse files
Add a public initializer to RenderContentMetadata (#1337)
* Add a public initializer to RenderContentMetadata * Update Sources/SwiftDocC/Model/Rendering/Content/RenderContentMetadata.swift Co-authored-by: David Rönnqvist <ronnqvist@apple.com> * Introduce PublicAPITests for verifying certain API are actually public. * Remove unneeded unit test in PublicAPITests.swift. --------- Co-authored-by: David Rönnqvist <ronnqvist@apple.com>
1 parent 304804b commit 758f91e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Sources/SwiftDocC/Model/Rendering/Content/RenderContentMetadata.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ public struct RenderContentMetadata: Equatable, Codable {
2020
public var abstract: [RenderInlineContent]?
2121
/// An optional identifier for the device frame that should wrap this element.
2222
public var deviceFrame: String?
23+
24+
/// Creates a new metadata value for a content element.
25+
/// - Parameters:
26+
/// - anchor: The named anchor of the content element.
27+
/// - title: The customized title for the content element.
28+
/// - abstract: The customized abstract for the content element.
29+
/// - deviceFrame: The identifier for the device frame that should wrap the content element.
30+
public init(anchor: String? = nil, title: String? = nil, abstract: [RenderInlineContent]? = nil, deviceFrame: String? = nil) {
31+
self.anchor = anchor
32+
self.title = title
33+
self.abstract = abstract
34+
self.deviceFrame = deviceFrame
35+
}
2336
}
2437

2538
extension RenderContentMetadata {

0 commit comments

Comments
 (0)