feat: Adds more documentation and examples.
All checks were successful
CI / Run tests. (push) Successful in 52s

This commit is contained in:
2024-12-08 18:27:31 -05:00
parent c6a269f062
commit 78a632c3e5
12 changed files with 149 additions and 7 deletions

View File

@@ -7,7 +7,9 @@ struct Application: ParsableCommand {
.init(
commandName: "examples",
subcommands: [
SectionCommand.self
SectionCommand.self,
VStackCommand.self,
HStackCommand.self
]
)
}

View File

@@ -0,0 +1,16 @@
import ArgumentParser
import CliDocCore
struct HStackCommand: ParsableCommand {
static let configuration = CommandConfiguration(commandName: "hstack")
func run() throws {
let note = HStack {
"NOTE:".color(.cyan).bold()
"This is my super cool note.".italic()
}
print()
print(note.render())
}
}

View File

@@ -21,10 +21,11 @@ struct SectionCommand: ParsableCommand {
struct MySectionStyle: SectionStyle {
func render(content: SectionConfiguration) -> some TextNode {
VStack(separator: .newLine(count: 2)) {
VStack {
content.header.color(.green).bold().underline()
content.content
content.footer.italic()
}
.separator(.newLine(count: 2))
}
}

View File

@@ -0,0 +1,21 @@
import ArgumentParser
import CliDocCore
struct VStackCommand: ParsableCommand {
static let configuration = CommandConfiguration(commandName: "vstack")
func run() throws {
let vstack = VStack {
"Blob Esquire"
.color(.yellow)
.bold()
.underline()
"Blob is a super awesome worker.".italic()
}
print()
print(vstack.render())
}
}