feat: Adds stack separators, removes some unused nodes from cli-doc module
All checks were successful
CI / Run tests. (push) Successful in 52s

This commit is contained in:
2024-12-08 10:58:03 -05:00
parent c977a1c805
commit c6a269f062
12 changed files with 229 additions and 177 deletions

View File

@@ -0,0 +1,29 @@
/// Represents the content of an ``HStack`` or a ``VStack``.
///
///
public struct StackConfiguration {
public let content: [any TextNode]
}
@usableFromInline
struct AnySeparatableStackNode<Separator: TextNode>: TextNode {
@usableFromInline
let content: [any TextNode]
@usableFromInline
let separator: Separator
@usableFromInline
init(content: StackConfiguration, separator: Separator) {
self.content = content.content
self.separator = separator
}
@usableFromInline
var body: some TextNode {
content.removingEmptys()
.map { $0.render() }
.joined(separator: separator.render())
}
}