feat: Adds vertical and horizontal separators, renames modifier protocol.
This commit is contained in:
@@ -69,8 +69,8 @@ public struct ExampleConfiguration {
|
||||
|
||||
// MARK: - Style
|
||||
|
||||
public protocol ExampleSectionStyle: NodeModifier where Content == ExampleSectionConfiguration {}
|
||||
public protocol ExampleStyle: NodeModifier where Content == ExampleConfiguration {}
|
||||
public protocol ExampleSectionStyle: TextModifier where Content == ExampleSectionConfiguration {}
|
||||
public protocol ExampleStyle: TextModifier where Content == ExampleConfiguration {}
|
||||
|
||||
public extension ExampleSection {
|
||||
|
||||
@@ -149,7 +149,7 @@ public struct DefaultExampleStyle: ExampleStyle {
|
||||
|
||||
@inlinable
|
||||
public func render(content: ExampleConfiguration) -> some TextNode {
|
||||
VStack(spacing: 2) {
|
||||
VStack(separator: .newLine(count: 2)) {
|
||||
content.examples.map { example in
|
||||
VStack {
|
||||
Label(example.label.green.bold)
|
||||
|
||||
@@ -86,7 +86,7 @@ public extension Note {
|
||||
|
||||
// MARK: - Style
|
||||
|
||||
public protocol NoteStyleModifier: NodeModifier where Content == NoteStyleConfiguration {}
|
||||
public protocol NoteStyleModifier: TextModifier where Content == NoteStyleConfiguration {}
|
||||
|
||||
public extension NoteStyleModifier where Self == DefaultNoteStyle {
|
||||
static var `default`: Self {
|
||||
|
||||
@@ -46,7 +46,7 @@ public extension ShellCommand {
|
||||
|
||||
// MARK: - Style
|
||||
|
||||
public protocol ShellCommandStyle: NodeModifier where Self.Content == ShellCommandConfiguration {}
|
||||
public protocol ShellCommandStyle: TextModifier where Self.Content == ShellCommandConfiguration {}
|
||||
|
||||
public extension ShellCommandStyle where Self == DefaultShellCommandStyle {
|
||||
static var `default`: Self { DefaultShellCommandStyle() }
|
||||
|
||||
Reference in New Issue
Block a user