feat: Adds more documentation and examples.
All checks were successful
CI / Run tests. (push) Successful in 52s
All checks were successful
CI / Run tests. (push) Successful in 52s
This commit is contained in:
@@ -7,7 +7,9 @@ struct Application: ParsableCommand {
|
||||
.init(
|
||||
commandName: "examples",
|
||||
subcommands: [
|
||||
SectionCommand.self
|
||||
SectionCommand.self,
|
||||
VStackCommand.self,
|
||||
HStackCommand.self
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
16
Examples/Sources/CliDoc-Examples/HStackCommand.swift
Normal file
16
Examples/Sources/CliDoc-Examples/HStackCommand.swift
Normal 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())
|
||||
}
|
||||
}
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
21
Examples/Sources/CliDoc-Examples/VStackCommand.swift
Normal file
21
Examples/Sources/CliDoc-Examples/VStackCommand.swift
Normal 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())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user