-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of #25.
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Sources/Slipstream/W3C/Elements/GroupingContent/Divider.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import SwiftSoup | ||
|
||
/// A divider represents a paragraph-level thematic break, e.g., a | ||
/// scene change in a story, or a transition to another topic within | ||
/// a section of a reference book. | ||
/// | ||
/// ```swift | ||
/// struct MySiteContent: View { | ||
/// var body: some View { | ||
/// Body { | ||
/// Div { | ||
/// Paragraph("Hello, world!") | ||
/// Divider() | ||
/// Paragraph("Let's make a website!") | ||
/// } | ||
/// } | ||
/// } | ||
/// } | ||
/// ``` | ||
/// | ||
/// - SeeAlso: W3C [`hr`](https://html.spec.whatwg.org/multipage/grouping-content.html#the-hr-element) specification. | ||
@available(iOS 17.0, macOS 14.0, *) | ||
public struct Divider: View { | ||
/// Creates a divider view. | ||
public init() { | ||
} | ||
|
||
@_documentation(visibility: private) | ||
public func render(_ container: Element, environment: EnvironmentValues) throws { | ||
_ = try container.appendElement("hr") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters