Files
Michael Housh 875b1980e0
All checks were successful
CI / Run tests. (push) Successful in 58s
feat: Working on documentation
2024-12-09 09:35:17 -05:00

39 lines
633 B
Swift

/// A group of text nodes.
///
/// This allows you to group content together, which can optionally be
/// styled.
///
/// ### Example:
///
/// ```swift
/// let group = Group {
/// "My headline."
/// "\n"
/// "Some content".color(.green)
/// "\n"
/// "Foo Bar".italic()
/// }
///
/// print(group.render())
/// ```
///
/// ![Group example](group.png)
///
public struct Group<Content: TextNode>: TextNode {
@usableFromInline
var content: Content
@inlinable
public init(
@TextBuilder content: () -> Content
) {
self.content = content()
}
@inlinable
public var body: some TextNode {
content
}
}