Exploring new style

This commit is contained in:
2024-12-03 07:53:12 -05:00
parent 3d82eed389
commit 8658035d51
5 changed files with 205 additions and 16 deletions

View File

@@ -0,0 +1,31 @@
@testable import CliDoc2
@preconcurrency import Rainbow
import Testing
let setupRainbow: Bool = {
Rainbow.enabled = true
Rainbow.outputTarget = .console
return true
}()
@Test
func testGroup() {
#expect(setupRainbow)
let group = Group {
Label { "Foo:" }.color(.blue)
"Bar"
"Baz"
Note { "Bang:" } content: { "boom" }
if setupRainbow {
Label("Hello, rainbow").color(.blue)
} else {
Label("No color for you!").color(.green)
}
}.color(.green)
print(group.render())
let note = Note { "Bang:" } content: { "boom" }
print(note.render())
print(type(of: note.label))
}