diff --git a/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
index df777111..4aeab472 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
@@ -1,11 +1,3 @@
-/*
- Abstract:
- The file contains the protocols for the aria html-attributes.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
@_documentation(visibility: internal)
public typealias GlobalAriaAttributes = AriaAtomicAttribute & AriaBusyAttribute & AriaControlsAttribute & AriaCurrentAttribute & AriaDescribedAttribute & AriaDetailsAttribute & AriaDisabledAttribute & AriaErrorMessageAttribute & AriaFlowToAttribute & AriaPopupAttribute & AriaHiddenAttribute & AriaInvalidAttribute & AriaShortcutsAttribute & AriaLabelAttribute & AriaLabeledAttribute & AriaLiveAttribute & AriaOwnsAttribute & AriaRelevantAttribute & AriaRoleDescriptionAttribute
diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
index 24e36d00..48b79130 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
@@ -1,29 +1,25 @@
-/*
- Abstract:
- The file contains the protocols for the basic html-attributes.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
/// The alias combines the global attributes of the basic attributes.
@_documentation(visibility: internal)
public typealias GlobalAttributes = AccessKeyAttribute & AutocapitalizeAttribute & AutofocusAttribute & ClassAttribute & EditAttribute & DirectionAttribute & DragAttribute & EnterKeyHintAttribute & HiddenAttribute & InputModeAttribute & IsAttribute & ItemIdAttribute & ItemPropertyAttribute & ItemReferenceAttribute & ItemScopeAttribute & ItemTypeAttribute & IdentifierAttribute & LanguageAttribute & NonceAttribute & RoleAttribute & SpellCheckAttribute & StyleAttribute & TabulatorAttribute & TitleAttribute & TranslateAttribute & InertAttribute & PopoverAttribute
-/// The protocol provides the element with the accesskey handler.
+/// A type that provides the `accessKey` modifier.
@_documentation(visibility: internal)
public protocol AccessKeyAttribute: Attribute {
- /// The function represents the html-attribute 'accesskey'.
+ /// Specifies a shortcut key.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .accessKey="A"
/// ```
///
- /// - Parameters:
- /// - value:
+ /// - Parameter value: The key to press.
+ ///
+ /// - Returns: The element
func accessKey(_ value: Character) -> Self
}
@@ -41,15 +37,21 @@ extension AccessKeyAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the accept handler.
+/// A type that provides the `accept` modifier.
@_documentation(visibility: internal)
public protocol AcceptAttribute: Attribute {
- /// The function represents the html-attribute 'accept'.
+ /// Filter accepted file types for upload.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .type(.file)
+ /// .accept("image/png, image/jpeg")
/// ```
+ ///
+ /// - Parameter value: The file types to pick from.
+ ///
+ /// - Returns: The element
func accept(_ value: String) -> Self
}
@@ -67,16 +69,33 @@ extension AcceptAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the action handler.
+/// A type that provides the `action` modifier.
@_documentation(visibility: internal)
public protocol ActionAttribute: Attribute {
- /// The function represents the html-attribute 'action'.
+ /// Specify where to send the form data.
///
- /// ```html
- ///
+ /// ```swift
+ /// Form {
+ /// Label {
+ /// "Lorem ipsum..."
+ /// }
+ /// Input()
+ /// .type(.text)
+ /// .name("lorem")
+ /// Button {
+ /// "Submit"
+ /// }
+ /// .type(.submit)
+ /// }
+ /// .action("https://...")
+ /// .method(.get)
/// ```
- func action(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to send to.
+ ///
+ /// - Returns: The element
+ func action(_ url: String) -> Self
}
extension ActionAttribute where Self: ContentNode {
@@ -93,7 +112,7 @@ extension ActionAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the alternate handler.
+/// A type that provides the `alternate` modifier.
@_documentation(visibility: internal)
public protocol AlternateAttribute: Attribute {
@@ -104,7 +123,7 @@ public protocol AlternateAttribute: Attribute {
/// .alternate("Lorem ipsum...")
/// ```
///
- /// - Parameter value: The text to describe the image
+ /// - Parameter value: The text to describe the image.
///
/// - Returns: The element
func alternate(_ value: String) -> Self
@@ -116,8 +135,8 @@ public protocol AlternateAttribute: Attribute {
/// .alternate("Lorem ipsum...")
/// ```
///
- /// - Parameter localizedKey: The string key to be translated
- /// - Parameter tableName: The translation table to look in
+ /// - Parameter localizedKey: The string key to be translated.
+ /// - Parameter tableName: The translation table to look in.
///
/// - Returns: The element
func alternate(_ localizedKey: LocalizedStringKey, tableName: String?) -> Self
@@ -129,7 +148,7 @@ public protocol AlternateAttribute: Attribute {
/// .alternate(verbatim: "Lorem ipsum...")
/// ```
///
- /// - Parameter value: The text to describe the image
+ /// - Parameter value: The text to describe the image.
///
/// - Returns: The element
func alternate(verbatim value: String) -> Self
@@ -158,15 +177,20 @@ extension AlternateAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the asynchronously handler.
+/// A type that provides the `asynchronously` modifier.
@_documentation(visibility: internal)
public protocol AsynchronouslyAttribute: Attribute {
- /// The function represents the html-attribute 'async'.
+ /// Mark a script to be executed asynchronously.
///
- /// ```html
- ///
+ /// ```swift
+ /// Script {
+ /// "Lorem ipsum..."
+ /// }
+ /// .asynchronously()
/// ```
+ ///
+ /// - Returns: The element
func asynchronously() -> Self
}
@@ -184,15 +208,20 @@ extension AsynchronouslyAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the autocapitalize handler.
+/// A type that provides the `autocapitalize` modifier.
@_documentation(visibility: internal)
public protocol AutocapitalizeAttribute: Attribute {
- /// The function represents the html-attribute 'autocapitalize'.
+ /// Control the capitalization manner.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .autocapitalize(.word)
/// ```
+ ///
+ /// - Parameter value: The manner in which to capitalize.
+ ///
+ /// - Returns: The element
func autocapitalize(_ value: Values.Capitalization) -> Self
}
@@ -221,7 +250,7 @@ public protocol AutocompleteAttribute: Attribute {
/// .autocomplete(.off)
/// ```
///
- /// - Parameter value: The value to be expected
+ /// - Parameter value: The value to be expected.
///
/// - Returns: The element
func autocomplete(_ value: Values.Completion) -> Self
@@ -233,7 +262,7 @@ public protocol AutocompleteAttribute: Attribute {
/// .autocomplete([.organization, .organizationTitle])
/// ```
///
- /// - Parameter values: The values to be expected
+ /// - Parameter values: The values to be expected.
///
/// - Returns: The element
func autocomplete(_ values: OrderedSet) -> Self
@@ -253,14 +282,17 @@ extension AutocompleteAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the autofocus handler.
+/// A type that provides the `autofocus` modifier.
@_documentation(visibility: internal)
public protocol AutofocusAttribute: Attribute {
- /// The function represents the html-attribute 'autofocus'.
+ /// Focus the element on page load.
///
- /// ```html
- ///
+ /// ```swift
+ /// Button {
+ /// "Lorem ipsum..."
+ /// }
+ /// .autofocus()
/// ```
func autofocus() -> Self
}
@@ -279,17 +311,32 @@ extension AutofocusAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the autoplay handler.
+/// A type that provides the `autoplay` modifier.
@_documentation(visibility: internal)
public protocol AutoplayAttribute: Attribute {
- /// The function represents the html-attribute 'autoplay'.
+ /// Mark the video as autoplay.
///
- /// ```html
- ///
+ /// ```swift
+ /// Video {
+ /// Source()
+ /// }
+ /// .autoplay()
/// ```
func autoplay() -> Self
+ /// Mark the video as autoplay.
+ ///
+ /// ```swift
+ /// Video {
+ /// Source()
+ /// }
+ /// .autoplay(true)
+ /// ```
+ ///
+ /// - Parameter condition: Whether to play automatically.
+ ///
+ /// - Returns: The element
func autoplay(_ condition: Bool) -> Self
}
@@ -307,15 +354,20 @@ extension AutoplayAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the charset handler.
+/// A type that provides the `charset` modifier.
@_documentation(visibility: internal)
public protocol CharsetAttribute: Attribute {
- /// The function represents the html-attribute 'charset'.
+ /// Specify the character encoding for the document.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meta()
+ /// .charset(.utf8)
/// ```
+ ///
+ /// - Parameter value: The encoding to use.
+ ///
+ /// - Returns: The element
func charset(_ value: Values.Charset) -> Self
}
@@ -333,17 +385,30 @@ extension CharsetAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the checked handler.
+/// A type that provides the `checked` modifier.
@_documentation(visibility: internal)
public protocol CheckedAttribute: Attribute {
- /// The function represents the html-attribute 'checked'.
+ /// Mark an input as pre-selected
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .type(.radio)
+ /// .checked()
/// ```
func checked() -> Self
+ /// Mark an input as pre-selected
+ ///
+ /// ```swift
+ /// Input()
+ /// .type(.radio)
+ /// .checked(true)
+ /// ```
+ ///
+ /// - Parameter condition: Whether the input should be pre-selected.
+ ///
+ /// - Returns: The element
func checked(_ condition: Bool) -> Self
}
@@ -361,16 +426,23 @@ extension CheckedAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the cite handler.
+/// A type that provides the `cite` modifier.
@_documentation(visibility: internal)
public protocol CiteAttribute: Attribute {
- /// The function represents the html-attribute 'cite'.
+ /// Specifiy a url that explains the quote.
///
- /// ```html
- ///
+ /// ```swift
+ /// Blockquote {
+ /// "Lorem ipsum..."
+ /// }
+ /// .cite("https://...")
/// ```
- func cite(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to cite from.
+ ///
+ /// - Returns: The element
+ func cite(_ url: String) -> Self
}
extension CiteAttribute where Self: ContentNode {
@@ -387,15 +459,22 @@ extension CiteAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the class handler.
+/// A type that provides the `class` modifier.
@_documentation(visibility: internal)
public protocol ClassAttribute: Attribute{
- /// The function represents the html-attribute 'class'.
+ /// Use a style class on an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .class("text")
/// ```
+ ///
+ /// - Parameter value: The class to apply to.
+ ///
+ /// - Returns: The element
func `class`(_ value: String) -> Self
}
@@ -413,16 +492,23 @@ extension ClassAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the columns handler.
+/// A type that provides the `columns` modifier.
@_documentation(visibility: internal)
public protocol ColumnsAttribute: Attribute {
- /// The function represents the html-attribute 'cols'.
+ /// Specify the visible width of a text area.
///
- /// ```html
- ///
+ /// ```swift
+ /// TextArea {
+ /// "Lorem ipsum..."
+ /// }
+ /// .columns(10)
/// ```
- func columns(_ size: Int) -> Self
+ ///
+ /// - Parameter number: The number of columns to base the width on.
+ ///
+ /// - Returns: The element
+ func columns(_ number: Int) -> Self
}
extension ColumnsAttribute where Self: ContentNode {
@@ -439,15 +525,23 @@ extension ColumnsAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the columnspan handler.
+/// A type that provides the `columnSpan` modifier.
@_documentation(visibility: internal)
public protocol ColumnSpanAttribute: Attribute {
- /// The function represents the html-attribute 'colspan'.
+ /// Specify the number of columns a cell should span.
///
- /// ```html
- ///
+ /// ```swift
+ /// TableRow {
+ /// DataCell {
+ /// "Lorem ipsum..."
+ /// }
+ /// .columnSpan(2)
+ /// }
/// ```
+ /// - Parameter size: The number of columns to span.
+ ///
+ /// - Returns: The element
func columnSpan(_ size: Int) -> Self
}
@@ -465,7 +559,7 @@ extension ColumnSpanAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the content handler.
+/// A type that provides the `content` modifier.
@_documentation(visibility: internal)
public protocol ContentAttribute: Attribute {
@@ -532,16 +626,23 @@ extension ContentAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the iseditable handler.
+/// A type that provides the `isEditable` modifier.
@_documentation(visibility: internal)
public protocol EditAttribute: Attribute {
- /// The function represents the html-attribute 'contenteditable'.
+ /// Mark an element as editable.
///
- /// ```html
- ///
+ /// ```swift
+ /// Blockquote {
+ /// "Lorem ipsum..."
+ /// }
+ /// .isEditable(false)
/// ```
- func isEditable(_ value: Bool) -> Self
+ ///
+ /// - Parameter condition: Whether the element should be editable.
+ ///
+ /// - Returns: The element
+ func isEditable(_ condition: Bool) -> Self
}
extension EditAttribute where Self: ContentNode {
@@ -558,15 +659,20 @@ extension EditAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the controls handler.
+/// A type that provides the `controls` modifier.
@_documentation(visibility: internal)
public protocol ControlsAttribute: Attribute {
- /// The function represents the html-attribute 'controls'.
+ /// Display the controls
///
- /// ```html
- ///
+ /// ```swift
+ /// Audio {
+ /// Source()
+ /// }
+ /// .controls()
/// ```
+ ///
+ /// - Returns: The element
func controls() -> Self
}
@@ -584,15 +690,21 @@ extension ControlsAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the coordinates handler.
+/// A type that provides the `coordinates` modifier.
@_documentation(visibility: internal)
public protocol CoordinatesAttribute: Attribute {
- /// The function represents the html-attribute 'coordinates'.
+ /// Use coordinates to define the area.
///
- /// ```html
- ///
+ /// ```swift
+ /// Area()
+ /// .shape(.rect)
+ /// .coordinates("0, 0, 200, 100")
/// ```
+ ///
+ /// - Parameter value: The coordinates on which to base the shape.
+ ///
+ /// - Returns: The element
func coordinates(_ value: String) -> Self
}
@@ -610,16 +722,22 @@ extension CoordinatesAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the date handler.
+/// A type that provides the `data` modifier.
@_documentation(visibility: internal)
public protocol DataAttribute: Attribute{
- /// The function represents the html-attribute 'data'.
+ /// Specify the url of the resource.
///
- /// ```html
- ///
+ /// ```swift
+ /// Object {
+ /// }
+ /// .data("https://...")
/// ```
- func data(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url of the resource to use.
+ ///
+ /// - Returns: The element
+ func data(_ url: String) -> Self
}
extension DataAttribute where Self: ContentNode {
@@ -636,15 +754,22 @@ extension DataAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the datetime handler.
+/// A type that provides the `dateTime` modifier.
@_documentation(visibility: internal)
public protocol DateTimeAttribute: Attribute {
- /// The function represents the html-attribute 'datetime'.
+ /// Specify the date and time.
///
- /// ```html
- ///
+ /// ```swift
+ /// Time {
+ /// "Lorem ipsum..."
+ /// }
+ /// .dateTime("")
/// ```
+ ///
+ /// - Parameter value: The date or time to represent.
+ ///
+ /// - Returns: The element
func dateTime(_ value: String) -> Self
}
@@ -662,15 +787,18 @@ extension DateTimeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the default handler.
+/// A type that provides the `default` modifier.
@_documentation(visibility: internal)
public protocol DefaultAttribute: Attribute {
- /// The function represents the html-attribute 'default'.
+ /// Mark a track as default.
///
- /// ```html
- ///
+ /// ```swift
+ /// Track()
+ /// .default()
/// ```
+ ///
+ /// - Returns: The element
func `default`() -> Self
}
@@ -688,15 +816,20 @@ extension DefaultAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the defer handler.
+/// A type that provides the `defer` modifier.
@_documentation(visibility: internal)
public protocol DeferAttribute: Attribute {
- /// The function represents the html-attribute 'defer'.
+ /// Mark a script as defer.
///
- /// ```html
- ///
+ /// ```swift
+ /// Script {
+ /// "Lorem ipsum..."
+ /// }
+ /// .defer()
/// ```
+ ///
+ /// - Returns: The element
func `defer`() -> Self
}
@@ -714,17 +847,22 @@ extension DeferAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the direction handler.
+/// A type that provides the `direction` modifier.
@_documentation(visibility: internal)
public protocol DirectionAttribute: Attribute {
- /// The function represents the html-attribute 'dir'.
- ///
- /// It specifies the element's text directionality.
+ /// Set the text direction.
///
- /// ```html
- ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum"
+ /// }
+ /// .direction(.auto)
/// ```
+ ///
+ /// - Parameter value: The direction to apply.
+ ///
+ /// - Returns: The element
func direction(_ value: Values.Direction) -> Self
}
@@ -742,17 +880,28 @@ extension DirectionAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the disabled handler
+/// A type that provides the `disabled` modifier.
@_documentation(visibility: internal)
public protocol DisabledAttribute: Attribute {
- /// The function represents the html-attribute 'disabled'.
+ /// Disable the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .disabled()
/// ```
func disabled() -> Self
+ /// Disable the element.
+ ///
+ /// ```swift
+ /// Input()
+ /// .disabled(true)
+ /// ```
+ ///
+ /// - Parameter condition: Whether to disable the element.
+ ///
+ /// - Returns: The element
func disabled(_ condition: Bool) -> Self
}
@@ -770,15 +919,20 @@ extension DisabledAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the download handler.
+/// A type that provides the `download` modifier.
@_documentation(visibility: internal)
public protocol DownloadAttribute: Attribute {
- /// The function represents the html-attribute 'download'.
+ /// Mark the target as downloadable.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .download()
/// ```
+ ///
+ /// - Returns: The element
func download() -> Self
}
@@ -796,16 +950,23 @@ extension DownloadAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the isdraggable handler.
+/// A type that provides the `isDraggable` modifier.
@_documentation(visibility: internal)
public protocol DragAttribute: Attribute {
- /// The function represents the html-attribute 'draggable'.
+ /// Mark an element as draggable.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ /// ...
+ /// }
+ /// .isDraggable(false)
/// ```
- func isDraggable(_ value: Bool) -> Self
+ ///
+ /// - Parameter condition: Whether the element should be draggable.
+ ///
+ /// - Returns: The element
+ func isDraggable(_ condition: Bool) -> Self
}
extension DragAttribute where Self: ContentNode {
@@ -822,17 +983,21 @@ extension DragAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the encoding handler.
+/// A type that provides the `encoding` modifier.
@_documentation(visibility: internal)
public protocol EncodingAttribute: Attribute {
- /// The function represents the html-attribute 'enctype'.
- ///
- /// It specifies encoding type to use for form submission.
+ /// Specify the encoding strategy for form submission.
///
- /// ```html
- ///
+ /// ```swift
+ /// Form {
+ /// }
+ /// .encoding(.multipart)
/// ```
+ ///
+ /// - Parameter value: The strategy to use for the encoding.
+ ///
+ /// - Returns: The element
func encoding(_ value: Values.Encoding) -> Self
}
@@ -850,17 +1015,21 @@ extension EncodingAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the enterkeyhint handler.
+/// A type that provides the `enterKeyHint` modifier.
@_documentation(visibility: internal)
public protocol EnterKeyHintAttribute: Attribute {
- /// The function represents the html-attribute 'enterkeyhint'.
- ///
- /// It specifies what action label to present for the enter key on virtual keyboards.
+ /// Change the enter key for the virtual keyboards.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .type(.text)
+ /// .enterKeyHint(.search)
/// ```
+ ///
+ /// - Parameter value: The enter key to apply.
+ ///
+ /// - Returns: The element
func enterKeyHint(_ value: Values.Hint) -> Self
}
@@ -878,18 +1047,23 @@ extension EnterKeyHintAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the for handler.
+/// A type that provides the `for` modifier.
@_documentation(visibility: internal)
public protocol ForAttribute: Attribute {
- /// The function represents the html-attribute 'for'.
- ///
- /// It specifies the form control with wich the caption is be associated.
+ /// Specify the association with the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Label {
+ /// "Lorem ipsum..."
+ /// }
+ /// .for("id")
/// ```
- func `for`(_ value: String) -> Self
+ ///
+ /// - Parameter id: The identifier of the element its bound to.
+ ///
+ /// - Returns: The element
+ func `for`(_ id: String) -> Self
}
extension ForAttribute where Self: ContentNode {
@@ -906,16 +1080,23 @@ extension ForAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the form handler.
+/// A type that provides the `form` modifier.
@_documentation(visibility: internal)
public protocol FormAttribute: Attribute {
- /// The function represents the html-attribute 'form'.
+ /// Specify the form the element belongs to.
///
- /// ```html
- ///
+ /// ```swift
+ /// Button {
+ /// "Lorem ipsum..."
+ /// }
+ /// .form("id")
/// ```
- func form(_ value: String) -> Self
+ ///
+ /// - Parameter id: The identifier of the form its bound to.
+ ///
+ /// - Returns: The element
+ func form(_ id: String) -> Self
}
extension FormAttribute where Self: ContentNode {
@@ -932,18 +1113,27 @@ extension FormAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the formaction handler.
+/// A type that provides the `formAction` modifier.
@_documentation(visibility: internal)
public protocol FormActionAttribute: Attribute {
- /// The function represents the html-attribute 'formaction'.
+ /// Set a target url to use for form submissions.
///
- /// It sets the url to use for form submissions
- ///
- /// ```html
- ///
+ /// ```swift
+ /// Form {
+ /// Button {
+ /// "Submit"
+ /// }
+ /// .type(.submit)
+ /// .formAction("https://...")
+ /// }
+ /// .method(.get)
/// ```
- func formAction(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to send the form data to.
+ ///
+ /// - Returns: The element
+ func formAction(_ url: String) -> Self
}
extension FormActionAttribute where Self: ContentNode {
@@ -960,17 +1150,20 @@ extension FormActionAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the http-equiv handler.
+/// A type that provides the `equivalent` modifier.
@_documentation(visibility: internal)
public protocol EquivalentAttribute: Attribute {
- /// The function represents the html-attribute 'http-equiv'.
- ///
- /// It specifiies the header cells for the element.
+ /// Specify the header directive equivalent.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meta()
+ /// .equivalent(.refresh)
/// ```
+ ///
+ /// - Parameter value: The header directive to simulate.
+ ///
+ /// - Returns: The element
func equivalent(_ value: Values.Equivalent) -> Self
}
@@ -988,18 +1181,23 @@ extension EquivalentAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the headers handler.
+/// A type that provides the `headers` modifier.
@_documentation(visibility: internal)
public protocol HeaderAttribute: Attribute {
- /// The function represents the html-attribute 'headers'.
- ///
- /// It specifiies the header cells for the element.
+ /// Specify the header cells for an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// DataCell {
+ /// "Lorem ipsum..."
+ /// }
+ /// .headers("ids")
/// ```
- func headers(_ value: String) -> Self
+ ///
+ /// - Parameter ids: The identifiers of the cells to associate with.
+ ///
+ /// - Returns: The element
+ func headers(_ ids: String) -> Self
}
extension HeaderAttribute where Self: ContentNode {
@@ -1016,17 +1214,20 @@ extension HeaderAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the height handler.
+/// A type that provides the `height` modifier.
@_documentation(visibility: internal)
public protocol HeightAttribute: Attribute {
- /// The function represents the html-attribute 'height'.
- ///
- /// It sets the height of the element.
+ /// Set the actual height for the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Image()
+ /// .height(200)
/// ```
+ ///
+ /// - Parameter size: The height to constrain the element to.
+ ///
+ /// - Returns: The element
func height(_ size: Int) -> Self
}
@@ -1044,17 +1245,34 @@ extension HeightAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with hidden handler.
+/// A type that provides the `hidden` modifier.
@_documentation(visibility: internal)
public protocol HiddenAttribute: Attribute {
-
- /// The function represents the html-attribute 'hidden'.
- ///
- /// ```html
- ///
- /// ```
+
+ /// Hide an element.
+ ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .hidden()
+ /// ```
+ ///
+ /// - Returns: The element
func hidden() -> Self
+ /// Hide an element.
+ ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .hidden(false)
+ /// ```
+ ///
+ /// - Parameter condition: Whether to hide the element.
+ ///
+ /// - Returns: The element
func hidden(_ condition: Bool) -> Self
}
@@ -1072,17 +1290,21 @@ extension HiddenAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with high handler.
+/// A type that provides the `high` modifier.
@_documentation(visibility: internal)
public protocol HighAttribute: Attribute {
- /// The function represents the html-attribute 'high'.
- ///
- /// It sets the range of the value.
+ /// Specify the high threshold for the range.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meter {
+ /// }
+ /// .high(40)
/// ```
+ ///
+ /// - Parameter value: The value to consider high.
+ ///
+ /// - Returns: The element
func high(_ value: Float) -> Self
}
@@ -1100,18 +1322,23 @@ extension HighAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with reference handler.
+/// A type that provides the `reference` modifier.
@_documentation(visibility: internal)
public protocol ReferenceAttribute: Attribute {
- /// The function represents the html-attribute 'href'.
- ///
- /// It gives the adress of the link.
+ /// Specify the url for a link.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://...")
/// ```
- func reference(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to refer to.
+ ///
+ /// - Returns: The element
+ func reference(_ url: String) -> Self
}
extension ReferenceAttribute where Self: ContentNode {
@@ -1128,17 +1355,22 @@ extension ReferenceAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the language reference handler.
+/// A type that provides the `referenceLanguage` modifier.
@_documentation(visibility: internal)
public protocol ReferenceLanguageAttribute: Attribute {
- /// The function represents the html-attribute 'hreflang'.
- ///
- /// It gives the language of the linked resource.
+ /// Indicate the content language of the linked resource.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://...")
+ /// .referenceLanguage(.en)
/// ```
+ /// - Parameter value: The language to expect at the linked resource.
+ ///
+ /// - Returns: The element
func referenceLanguage(_ value: Values.Language) -> Self
}
@@ -1156,17 +1388,21 @@ extension ReferenceLanguageAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the id handler.
+/// A type that provides the `id` modifier.
@_documentation(visibility: internal)
public protocol IdentifierAttribute: Attribute {
- /// The function represents the html-attribute 'id'.
- ///
- /// It specifies its element's unique identifier.
+ /// Set an unique identifier.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ /// }
+ /// .id("content")
/// ```
+ ///
+ /// - Parameter value: The identifier to recognize by.
+ ///
+ /// - Returns: The element
func id(_ value: String) -> Self
}
@@ -1247,16 +1483,23 @@ extension InputModeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the inputmode handler.
+/// A type that provides the `is` modifier.
@_documentation(visibility: internal)
public protocol IsAttribute: Attribute {
- /// The function represents the html-attribute 'is'.
+ /// Refere to a custom element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .is("foo-bar")
/// ```
- func `is`(_ value: String) -> Self
+ ///
+ /// - Parameter name: The name of the custom element to refere to.
+ ///
+ /// - Returns: The element
+ func `is`(_ name: String) -> Self
}
extension IsAttribute where Self: ContentNode {
@@ -1273,15 +1516,21 @@ extension IsAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the itemid handler.
+/// A type that provides the `itemId` modifier.
@_documentation(visibility: internal)
public protocol ItemIdAttribute: Attribute {
- /// The function represents the html-attribute 'itemid'.
+ /// Set an unique identifier for an item.
///
- /// ```html
- ///
+ /// ```swift
+ /// DefinitionList {
+ /// }
+ /// .itemId("urn:...")
/// ```
+ ///
+ /// - Parameter value: The identifier to name the item after.
+ ///
+ /// - Returns: The element
func itemId(_ value: String) -> Self
}
@@ -1299,15 +1548,22 @@ extension ItemIdAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the itemproperty handler.
+/// A type that provides the `itemProperty` modifier.
@_documentation(visibility: internal)
public protocol ItemPropertyAttribute: Attribute {
- /// The function represents the html-attribute 'itemprop'.
+ /// Create an item property on an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Span {
+ /// "Lorem ipsum..."
+ /// }
+ /// .itemProperty("")
/// ```
+ ///
+ /// - Parameter value: The name used for the property.
+ ///
+ /// - Returns: The element
func itemProperty(_ value: String) -> Self
}
@@ -1325,15 +1581,21 @@ extension ItemPropertyAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the itemreference handler.
+/// A type that provides the `itemReference` modifier.
@_documentation(visibility: internal)
public protocol ItemReferenceAttribute: Attribute {
- /// The function represents the html-attribute 'itemref'.
+ /// Refer to other elements with additional item properties.
///
- /// ```html
- ///
+ /// ```swift
+ /// DefinitionList {
+ /// }
+ /// .itemReference("foo bar")
/// ```
+ ///
+ /// - Parameter value: The identifiers to relate to.
+ ///
+ /// - Returns: The element
func itemReference(_ value: String) -> Self
}
@@ -1351,15 +1613,20 @@ extension ItemReferenceAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the itemscope handler.
+/// A type that provides the `itemScope` modifier.
@_documentation(visibility: internal)
public protocol ItemScopeAttribute: Attribute {
- /// The function represents the html-attribute 'itemscope'.
+ /// Create a new item scope.
///
- /// ```html
- ///
+ /// ```swift
+ /// DefinitionList {
+ /// "Lorem ipsum..."
+ /// }
+ /// .itemScope()
/// ```
+ ///
+ /// - Returns: The element
func itemScope(_ value: String) -> Self
}
@@ -1377,16 +1644,22 @@ extension ItemScopeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the itemtype handler
+/// A type that provides the `itemType` modifier.
@_documentation(visibility: internal)
public protocol ItemTypeAttribute: Attribute {
- /// The function represents the html-attribute 'itemtype'.
+ /// Refer to an item vocabulary.
///
- /// ```html
- ///
+ /// ```swift
+ /// DefintionList {
+ /// }
+ /// .itemType("https://...")
/// ```
- func itemType(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url of the vocabulary to use.
+ ///
+ /// - Returns: The element
+ func itemType(_ url: String) -> Self
}
extension ItemTypeAttribute where Self: ContentNode {
@@ -1403,15 +1676,21 @@ extension ItemTypeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the kind handler.
+/// A type that provides the `kind` modifier.
@_documentation(visibility: internal)
public protocol KindAttribute: Attribute {
- /// The function represents the html-attribute 'kind'.
+ /// Hint the kind of track content.
///
- /// ```html
- ///
+ /// ```swift
+ /// Track()
+ /// .src(...vtt)
+ /// .kind(.chapters)
/// ```
+ ///
+ /// - Parameter value: The kind of content to associate with.
+ ///
+ /// - Returns: The element
func kind(_ value: Values.Kind) -> Self
}
@@ -1429,15 +1708,22 @@ extension KindAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the label handler.
+/// A type that provides the `label` modifier.
@_documentation(visibility: internal)
public protocol LabelAttribute: Attribute {
- /// The function represents the html-attribute 'label'.
+ /// Specify a label for the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Track()
+ /// .src(...vtt)
+ /// .kind(.chapters)
+ /// .label("lorem")
/// ```
+ ///
+ /// - Parameter value: The text to use as a label.
+ ///
+ /// - Returns: The element
func label(_ value: String) -> Self
}
@@ -1455,15 +1741,22 @@ extension LabelAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the language handler.
+/// A type that provides the `language` modifier.
@_documentation(visibility: internal)
public protocol LanguageAttribute: Attribute {
- /// The function represents the html-attribute 'lang'.
+ /// Specify the language for the following content.
///
- /// ```html
- ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .language(.german)
/// ```
+ ///
+ /// - Parameter value: The language used to intepret the content.
+ ///
+ /// - Returns: The element
func language(_ value: Values.Language) -> Self
}
@@ -1481,16 +1774,21 @@ extension LanguageAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the list handler.
+/// A type that provides the `list` modifier.
@_documentation(visibility: internal)
public protocol ListAttribute: Attribute {
- /// The function represents the html-attribute 'list'.
+ /// Refere to a datalist.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .list("")
/// ```
- func list(_ value: String) -> Self
+ ///
+ /// - Parameter id: The identifier of the datalist.
+ ///
+ /// - Returns: The element.
+ func list(_ id: String) -> Self
}
extension ListAttribute where Self: ContentNode {
@@ -1541,15 +1839,21 @@ extension LoopAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the low handler.
+/// A type that provides the `low` modifier.
@_documentation(visibility: internal)
public protocol LowAttribute: Attribute {
- /// The function represents the html-attribute 'low'.
+ /// Specify the low threshold for the range.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meter {
+ /// }
+ /// .low(40)
/// ```
+ ///
+ /// - Parameter value: The value to consider low.
+ ///
+ /// - Returns: The element
func low(_ value: Float) -> Self
}
@@ -1567,17 +1871,21 @@ extension LowAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the maximumvalue handler.
+/// A type that provides the `maximum` modifier.
@_documentation(visibility: internal)
public protocol MaximumValueAttribute: Attribute {
associatedtype MaximumValueType
- /// The function represents the html-attribute 'max'.
+ /// Specify the maximum bound for the range.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .maximum(100)
/// ```
+ /// - Parameter value: The value to consider maximum.
+ ///
+ /// - Returns: The element
func maximum(_ value: MaximumValueType) -> Self
}
@@ -1595,15 +1903,22 @@ extension MaximumValueAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the maximumlength handler.
+/// A type that provides the `maximum(length:)` modifier.
@_documentation(visibility: internal)
public protocol MaximumLengthAttribute: Attribute {
- /// The function represents the html-attribute 'maxlength'.
+ /// Set the maximum string length.
///
- /// ```html
- ///
+ /// ```swift
+ /// TextArea {
+ /// "Lorem ipsum..."
+ /// }
+ /// .maximum(length: 10)
/// ```
+ ///
+ /// - Parameter value: The maximum number of characters to require.
+ ///
+ /// - Returns: The element
func maximum(length value: Int) -> Self
}
@@ -1621,15 +1936,21 @@ extension MaximumLengthAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the media handler.
+/// A type that provides the `media` modifier.
@_documentation(visibility: internal)
public protocol MediaAttribute: Attribute {
- /// The function represents the html-attribute 'media'.
+ /// Specify the media the ressource is optimized for.
///
- /// ```html
- ///
+ /// ```swift
+ /// Link()
+ /// .reference("https://...")
+ /// .media("print")
/// ```
+ ///
+ /// - Parameter value: The media to be considered.
+ ///
+ /// - Returns: The element
func media(_ value: String) -> Self
}
@@ -1647,15 +1968,21 @@ extension MediaAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the method handler.
+/// A type that provides the `method` modifier.
@_documentation(visibility: internal)
public protocol MethodAttribute: Attribute {
- /// The function represents the html-attribute 'method'.
+ /// Specify how to send form data.
///
- /// ```html
- ///
+ /// ```swift
+ /// Form {
+ /// }
+ /// .method(.post)
/// ```
+ ///
+ /// - Parameter value: The method to use for submission.
+ ///
+ /// - Returns: The element
func method(_ value: Values.Method) -> Self
}
@@ -1673,17 +2000,22 @@ extension MethodAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the minimumvalue handler.
+/// A type that provides the `minimum` modifier.
@_documentation(visibility: internal)
public protocol MinimumValueAttribute: Attribute {
associatedtype MinimumValueType
- /// The function represents the html-attribute 'min'.
+ /// Specify the minimum bound for the range.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .minimum(0)
/// ```
+ ///
+ /// - Parameter value: The value to consider minimum.
+ ///
+ /// - Returns: The element
func minimum(_ value: MinimumValueType) -> Self
}
@@ -1701,15 +2033,21 @@ extension MinimumValueAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the minimumlength handler.
+/// A type that provides the `minimum(length:)` modifier.
@_documentation(visibility: internal)
public protocol MinimumLengthAttribute: Attribute {
- /// The function represents the html-attribute 'minlength'.
+ /// Set the minimum string length.
///
- /// ```html
- ///
+ /// ```swift
+ /// TextArea {
+ /// "Lorem ipsum..."
+ /// }
+ /// .minimum(length: 10)
/// ```
+ /// - Parameter value: The minimum number of characters to require.
+ ///
+ /// - Returns: The element
func minimum(length value: Int) -> Self
}
@@ -1727,15 +2065,21 @@ extension MinimumLengthAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the multiple handler.
+/// A type that provides the `multiple` modifier.
@_documentation(visibility: internal)
public protocol MultipleAttribute: Attribute {
- /// The function represents the html-attribute 'multiple'.
+ /// Specify that the user is allowed to select more than one value.
///
- /// ```html
- ///
+ /// ```swift
+ /// Select {
+ /// Option()
+ /// Option()
+ /// }
+ /// .multiple()
/// ```
+ ///
+ /// - Returns: The element
func multiple() -> Self
}
@@ -1753,15 +2097,20 @@ extension MultipleAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the muted handler.
+/// A type that provides the `muted` modifier.
@_documentation(visibility: internal)
public protocol MutedAttribute: Attribute {
- /// The function represents the html-attribute 'muted'.
+ /// Mute the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Video {
+ /// Source()
+ /// }
+ /// .muted()
/// ```
+ ///
+ /// - Returns: The element
func muted() -> Self
}
@@ -1779,17 +2128,24 @@ extension MutedAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the name handler.
+/// A type that provides the `name` modifier.
@_documentation(visibility: internal)
public protocol NameAttribute: Attribute {
associatedtype NameValue
- /// The function represents the html-attribute 'name'.
+ /// Define a name for the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// ButtonĀ {
+ /// "Lorem ipsum..."
+ /// }
+ /// .name("lorem")
/// ```
+ ///
+ /// - Parameter value: The name to be referenced.
+ ///
+ /// - Returns: The element
func name(_ value: NameValue) -> Self
}
@@ -1807,15 +2163,22 @@ extension NameAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the nonce handler.
+/// A type that provides the `nonce` modifier.
@_documentation(visibility: internal)
public protocol NonceAttribute: Attribute {
- /// The function represents the html-attribute 'nonce'.
+ /// Use a nonce for an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Script {
+ /// const foo = 'bar';
+ /// }
+ /// .nonce("k9XJ2mL4qR8VpTeYw0HsZg==")
/// ```
+ ///
+ /// - Parameter value: The nonce to send with.
+ ///
+ /// - Returns: The element
func nonce(_ value: String) -> Self
}
@@ -1833,14 +2196,16 @@ extension NonceAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the novalidate handler.
+/// A type that provides the `novalidate` modifier.
@_documentation(visibility: internal)
public protocol NoValidateAttribute: Attribute {
- /// The function represents the html-attribute 'novalidate'.
+ /// Prevent the form from being validated.
///
- /// ```html
- ///
+ /// ```swift
+ /// Form {
+ /// }
+ /// .novalidate()
/// ```
func novalidate() -> Self
}
@@ -1859,16 +2224,28 @@ extension NoValidateAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the open handler.
+/// A type that provides the `isOpen` modifier.
@_documentation(visibility: internal)
public protocol OpenAttribute: Attribute {
- /// The function represents the html-attribute 'open'.
+ /// Mark the details as open.
///
- /// ```html
- ///
+ /// ```swift
+ /// Details {
+ /// Summary {
+ /// "Lorem ipsum"
+ /// }
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// }
+ /// .isOpen(true)
/// ```
- func isOpen(_ value: Bool) -> Self
+ ///
+ /// - Parameter condition: Whether the details should be open.
+ ///
+ /// - Returns: The element
+ func isOpen(_ condition: Bool) -> Self
}
extension OpenAttribute where Self: ContentNode {
@@ -1885,15 +2262,21 @@ extension OpenAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the optimum handler.
+/// A type that provides the `optimum` modifier.
@_documentation(visibility: internal)
public protocol OptimumAttribute: Attribute {
- /// The function represents the html-attribute 'optimum'.
+ /// Specify the optimum threshold for the range.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meter {
+ /// }
+ /// .optimum(10)
/// ```
+ ///
+ /// - Parameter value: The number to consider ideal.
+ ///
+ /// - Returns: The element
func optimum(_ value: Float) -> Self
}
@@ -1911,15 +2294,22 @@ extension OptimumAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the pattern handler.
+/// A type that provides the `pattern` modifier.
@_documentation(visibility: internal)
public protocol PatternAttribute: Attribute {
- /// The function represents the html-attribute 'pattern'.
+ /// Specifiy a regular expression for the input.
+ ///
+ /// The input value is checked against the regular expression on form submission.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .pattern("[A-Za-z]")
/// ```
+ ///
+ /// - Parameter regex: The pattern to check against.
+ ///
+ /// - Returns: The element
func pattern(_ regex: String) -> Self
}
@@ -1937,16 +2327,24 @@ extension PatternAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the part handler.
+/// A type that provides the `part` modifier.
@_documentation(visibility: internal)
public protocol PartAttribute: Attribute {
- /// The function represents the html-attribute 'part'.
+ /// Expose the element outside of the shadow tree.
///
- /// ```html
- ///
+ /// ```struct
+ /// Template {
+ /// Span {
+ /// }
+ /// .part("lorem")
+ /// }
/// ```
- func part(_ value: String) -> Self
+ ///
+ /// - Parameter name: The name of the element to expose.
+ ///
+ /// - Returns: The element
+ func part(_ name: String) -> Self
}
extension PartAttribute where Self: ContentNode {
@@ -1963,16 +2361,24 @@ extension PartAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the ping handler.
+/// A type that provides the `ping` modifier.
@_documentation(visibility: internal)
public protocol PingAttribute: Attribute {
- /// The function represents the html-attribute 'ping'.
+ /// Define a callback url.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://...")
+ /// .ping("https://...")
/// ```
- func ping(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to be notified.
+ ///
+ /// - Returns: The element
+ func ping(_ url: String) -> Self
}
extension PingAttribute where Self: ContentNode {
@@ -1989,7 +2395,7 @@ extension PingAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the placeholder handler.
+/// A type that provides the `placeholder` modifier.
@_documentation(visibility: internal)
public protocol PlaceholderAttribute: Attribute {
@@ -2053,16 +2459,23 @@ extension PlaceholderAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the poster handler.
+/// A type that provides the `poster` modifier.
@_documentation(visibility: internal)
public protocol PosterAttribute: Attribute {
- /// The function represents the html-attribute 'poster'.
+ /// Supply a fallback while the video is processing.
///
- /// ```html
- ///
+ /// ```swift
+ /// Video {
+ /// Source()
+ /// }
+ /// .poster("https://...")
/// ```
- func poster(_ value: String) -> Self
+ ///
+ /// - Parameter url: The absolute or relative url to point to.
+ ///
+ /// - Returns: The element
+ func poster(_ url: String) -> Self
}
extension PosterAttribute where Self: ContentNode {
@@ -2112,15 +2525,24 @@ extension PlaysInlineAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the preload handler.
+/// A type that provides the `preload` modifier.
@_documentation(visibility: internal)
public protocol PreloadAttribute: Attribute {
- /// The function represents the html-attribute 'preload'.
+ /// Define the loading behaviour.
///
- /// ```html
- ///
+ /// ```swift
+ /// Video {
+ /// Source()
+ /// .source("")
+ /// .type(.mp4)
+ /// }
+ /// .preload(.auto)
/// ```
+ ///
+ /// - Parameter value: The behaviour
+ ///
+ /// - Returns: The element
func preload(_ value: Values.Preload) -> Self
}
@@ -2138,17 +2560,30 @@ extension PreloadAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the readonly handler.
+/// A type that provides the `readonly` modifier.
@_documentation(visibility: internal)
public protocol ReadyOnlyAttribute: Attribute {
- /// The function represents the html-attribute 'readonly'.
+ /// Mark the input as read only.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .readonly()
/// ```
+ ///
+ /// - Returns: The element
func readonly() -> Self
+ /// Mark the input as read only based on a condition.
+ ///
+ /// ```swift
+ /// Input()
+ /// .readonly(false)
+ /// ```
+ ///
+ /// - Parameter condition: Whether the input should be read only.
+ ///
+ /// - Returns: The element
func readonly(_ condition: Bool) -> Self
}
@@ -2166,14 +2601,15 @@ extension ReadyOnlyAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the referrerpolicy handler.
+/// A type that provides the `referrerPolicy` modifier.
@_documentation(visibility: internal)
public protocol ReferrerPolicyAttribute: Attribute {
- /// The function represents the html-attribute 'referrerpolicy'.
+ /// Specify that no referrer information will be sent along with the request.
///
- /// ```html
- ///
+ /// ```swift
+ /// Link()
+ /// .referrerPolicy(.sameOrigin)
/// ```
func referrerPolicy(_ value: Values.Policy) -> Self
}
@@ -2192,15 +2628,23 @@ extension ReferrerPolicyAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the relationship handler.
+/// A type that provides the `relationship` modifier.
@_documentation(visibility: internal)
public protocol RelationshipAttribute: Attribute {
- /// The function represents the html-attribute 'rel'.
+ /// Indicate the relationship between documents.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://...")
+ /// .relationship(.author)
/// ```
+ ///
+ /// - Parameter value: The relationship type to associate with.
+ ///
+ /// - Returns: The element
func relationship(_ value: Values.Relation) -> Self
}
@@ -2218,17 +2662,30 @@ extension RelationshipAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the required handler.
+/// A type that provides the `required` modifier.
@_documentation(visibility: internal)
public protocol RequiredAttribute: Attribute {
- /// The function represents the html-attribute 'required'.
+ /// Mark an input as required.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .required()
/// ```
+ ///
+ /// - Returns: The element
func required() -> Self
+ /// Mark an input as required based on a condition.
+ ///
+ /// ```swift
+ /// Input()
+ /// .required(false)
+ /// ```
+ ///
+ /// - Parameter condition: Whether the element should be a requirement.
+ ///
+ /// - Returns: The element
func required(_ condition: Bool) -> Self
}
@@ -2246,15 +2703,22 @@ extension RequiredAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the reversed handler.
+/// A type that provides the `reversed` modifier.
@_documentation(visibility: internal)
public protocol ReversedAttribute: Attribute {
- /// The function represents the html-attribute 'reversed'.
+ /// Mark a list as reversed.
///
- /// ```html
- ///
+ /// ```swift
+ /// OrderedList {
+ /// ListItem {
+ /// "Lorem ipsum"
+ /// }
+ /// }
+ /// .reversed()
/// ```
+ ///
+ /// - Returns: The element
func reversed() -> Self
}
@@ -2272,15 +2736,23 @@ extension ReversedAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the role handler.
+/// A type that provides the `role` modifier.
@_documentation(visibility: internal)
public protocol RoleAttribute: Attribute {
- /// The function represents the html-attribute 'role'.
+ /// Describe the role of an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://...")
+ /// .role(.button)
/// ```
+ ///
+ /// - Parameter value: The role to inform about.
+ ///
+ /// - Returns: The element
func role(_ value: Values.Role) -> Self
}
@@ -2298,16 +2770,23 @@ extension RoleAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the rows handler.
+/// A type that provides the `rows` modifier.
@_documentation(visibility: internal)
public protocol RowsAttribute: Attribute {
- /// The function represents the html-attribute 'rows'.
+ /// Define the visible height of the text area.
///
- /// ```html
- ///
+ /// ```swift
+ /// TextArea {
+ /// "Lorem ipsum..."
+ /// }
+ /// .rows(4)
/// ```
- func rows(_ size: Int) -> Self
+ ///
+ /// - Parameter number: The number of rows to base the height on.
+ ///
+ /// - Returns: The element
+ func rows(_ number: Int) -> Self
}
extension RowsAttribute where Self: ContentNode {
@@ -2324,15 +2803,24 @@ extension RowsAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the rowspan handler.
+/// A type that provides the `rowSpan` modifier.
@_documentation(visibility: internal)
public protocol RowSpanAttribute: Attribute {
- /// The function represents the html-attribute 'rowspan'.
+ /// Specify the number of rows a cell should span
///
- /// ```html
- ///
+ /// ```swift
+ /// TableRow {
+ /// DataCell {
+ /// "Lorem ipsum..."
+ /// }
+ /// .rowSpan(2)
+ /// }
/// ```
+ ///
+ /// - Parameter size: The number of rows to span.
+ ///
+ /// - Returns: The element
func rowSpan(_ size: Int) -> Self
}
@@ -2351,8 +2839,6 @@ extension RowSpanAttribute where Self: EmptyNode {
}
/// A type that provides the `sandbox` modifier.
-///
-/// > Note: Currently, this protocol is only applicable to `InlineFrame`.
@_documentation(visibility: internal)
public protocol SandboxAttribute: Attribute {
@@ -2405,9 +2891,9 @@ extension SandboxAttribute where Self: EmptyNode {
@_documentation(visibility: internal)
public protocol ScopeAttribute: Attribute {
- /// Define the scope for a header cell
+ /// Define the scope for a header cell.
///
- /// It specifies wether the cell is for a column, row or a group of columns
+ /// It specifies whether the cell is for a column, row or a group of columns
/// and rows.
///
/// ```swift
@@ -2419,7 +2905,7 @@ public protocol ScopeAttribute: Attribute {
/// }
/// ```
///
- /// - Parameter value: The scope of the header cell
+ /// - Parameter value: The scope of the header cell.
func scope(_ value: Values.Scope) -> Self
}
@@ -2437,15 +2923,20 @@ extension ScopeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the shape handler.
+/// A type that provides the `shape` modifier.
@_documentation(visibility: internal)
public protocol ShapeAttribute: Attribute {
- /// The function represents the html-attribute 'shape'.
+ /// Define the shape for an area.
///
- /// ```html
- ///
+ /// ```swift
+ /// Area()
+ /// .shape(.circle)
/// ```
+ ///
+ /// - Parameter value: The shape used to interpret the coordinates.
+ ///
+ /// - Returns: The element
func shape(_ value: Values.Shape) -> Self
}
@@ -2463,15 +2954,20 @@ extension ShapeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the size handler.
+/// A type that provides the `size` modifier.
@_documentation(visibility: internal)
public protocol SizeAttribute: Attribute {
- /// The function represents the html-attribute 'size'.
+ /// Set the display size for an input.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .size(4)
/// ```
+ ///
+ /// - Parameter size: The length to constrain content to.
+ ///
+ /// - Returns: The element
func size(_ size: Int) -> Self
}
@@ -2489,15 +2985,20 @@ extension SizeAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the sizes handler.
+/// A type that provides the `sizes` modifier.
@_documentation(visibility: internal)
public protocol SizesAttribute: Attribute {
- /// The function represents the html-attribute 'sizes'.
+ /// Describe different sizes for different viewport sizes.
///
- /// ```html
- ///
+ /// ```swift
+ /// Link()
+ /// .sizes(16x16)
/// ```
+ ///
+ /// - Parameter size: The sizes to take into consideration.
+ ///
+ /// - Returns: The element
func sizes(_ size: Int) -> Self
}
@@ -2515,16 +3016,30 @@ extension SizesAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the slot handler.
+/// A type that provides the `slot` modifier.
@_documentation(visibility: internal)
public protocol SlotAttribute: Attribute {
- /// The function represents the html-attribute 'slot'.
+ /// Define named placeholders within a custom element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Template {
+ /// Slot {
+ /// }
+ /// .name("name")
+ /// }
+ /// Custom {
+ /// Heading1 {
+ /// "Lorem ipsum..."
+ /// }
+ /// .slot("name")
+ /// }
/// ```
- func slot(_ value: String) -> Self
+ ///
+ /// - Parameter name: The identifier to name after.
+ ///
+ /// - Returns: The element
+ func slot(_ name: String) -> Self
}
extension SlotAttribute where Self: ContentNode {
@@ -2541,15 +3056,20 @@ extension SlotAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the span handler.
+/// A type that provides the `span` modifier.
@_documentation(visibility: internal)
public protocol SpanAttribute: Attribute {
- /// The function represents the html-attribute 'span'.
+ /// Specify the span for a column.
///
- /// ```html
- ///
+ /// ```swift
+ /// Column()
+ /// .span(2)
/// ```
+ ///
+ /// - Parameter size: The number of columns to span.
+ ///
+ /// - Returns: The element
func span(_ size: Int) -> Self
}
@@ -2567,16 +3087,21 @@ extension SpanAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the hasspellcheck handler.
+/// A type that provides the `hasSpellCheck` modifier.
@_documentation(visibility: internal)
public protocol SpellCheckAttribute: Attribute {
- /// The function represents the html-attribute 'spellcheck'.
+ /// Mark a element as spellchecked.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .hasSpellCheck(false)
/// ```
- func hasSpellCheck(_ value: Bool) -> Self
+ ///
+ /// - Parameter condition: Whether to spellcheck the content.
+ ///
+ /// - Returns: The element
+ func hasSpellCheck(_ condition: Bool) -> Self
}
extension SpellCheckAttribute where Self: ContentNode {
@@ -2593,18 +3118,37 @@ extension SpellCheckAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the source handler.
+/// A type that provides the `source` modifier.
@_documentation(visibility: internal)
public protocol SourceAttribute: Attribute {
- /// The function represents the html-attribute 'src'.
+ /// Specify the url for the source.
///
- /// ```html
- ///
+ /// ```swift
+ /// Audio {
+ /// Source()
+ /// .type(.mpeg)
+ /// .source(....mpeg)
+ /// }
/// ```
- func source(_ value: String) -> Self
+ /// - Parameter url: The url to load from.
+ ///
+ /// - Returns: The element
+ func source(_ url: String) -> Self
- func source(_ value: EnvironmentValue) -> Self
+ /// Specify the url for the source.
+ ///
+ /// ```swift
+ /// Audio {
+ /// Source()
+ /// .type(.mpeg)
+ /// .source()
+ /// }
+ /// ```
+ /// - Parameter url: The url to load from.
+ ///
+ /// - Returns: The element
+ func source(_ url: EnvironmentValue) -> Self
}
extension SourceAttribute where Self: ContentNode {
@@ -2629,16 +3173,25 @@ extension SourceAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the start handler.
+/// A type that provides the `start` modifier.
@_documentation(visibility: internal)
public protocol StartAttribute: Attribute {
- /// The function represents the html-attribute 'start'.
+ /// Specify the start value for the list.
///
- /// ```html
- ///
+ /// ```swift
+ /// OrderedList {
+ /// ListItem {
+ /// "Lorem ipsum"
+ /// }
+ /// }
+ /// .start(10)
/// ```
- func start(_ size: Int) -> Self
+ ///
+ /// - Parameter number: The number to start to count from.
+ ///
+ /// - Returns: The element
+ func start(_ number: Int) -> Self
}
extension StartAttribute where Self: ContentNode {
@@ -2655,15 +3208,21 @@ extension StartAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the step handler.
+/// A type that provides the `step` modifier.
@_documentation(visibility: internal)
public protocol StepAttribute: Attribute {
- /// The function represents the html-attribute 'step'.
+ /// Specify the number intervals for an input.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .type(.number)
+ /// .step(3)
/// ```
+ ///
+ /// - Parameter size: The increment to use.
+ ///
+ /// - Returns: The element
func step(_ size: Int) -> Self
}
@@ -2681,15 +3240,22 @@ extension StepAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the style handler.
+/// A type that provides the `style` modifier.
@_documentation(visibility: internal)
public protocol StyleAttribute: Attribute {
- /// The function represents the html-attribute 'style'.
+ /// Specify an inline style for an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Heading1 {
+ /// "Lorem ipsum..."
+ /// }
+ /// .style("color: black;")
/// ```
+ ///
+ /// - Parameter value: The style to apply.
+ ///
+ /// - Returns: The element
func style(_ value: String) -> Self
}
@@ -2707,16 +3273,22 @@ extension StyleAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the tabindex handler.
+/// A type that provides the `tabIndex` modifier.
@_documentation(visibility: internal)
public protocol TabulatorAttribute: Attribute {
- /// The function represents the html-attribute 'tabindex'.
+ /// Specify the tab order.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ /// }
+ /// .tabIndex(3)
/// ```
- func tabIndex(_ value: Int) -> Self
+ ///
+ /// - Parameter number: The number for the order.
+ ///
+ /// - Returns: The element
+ func tabIndex(_ number: Int) -> Self
}
extension TabulatorAttribute where Self: ContentNode {
@@ -2733,15 +3305,23 @@ extension TabulatorAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the target handler.
+/// A type that provides the `target` modifier.
@_documentation(visibility: internal)
public protocol TargetAttribute: Attribute {
- /// The function represents the html-attribute 'target'.
+ /// Define where to open the linked document.
///
- /// ```html
- ///
+ /// ```swift
+ /// Anchor {
+ /// "Lorem ipsum..."
+ /// }
+ /// .reference("https://")
+ /// .target(.blank)
/// ```
+ ///
+ /// - Parameter value: The kind of target to indicate.
+ ///
+ /// - Returns: The element
func target(_ value: Values.Target) -> Self
}
@@ -2759,7 +3339,7 @@ extension TargetAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the title handler.
+/// A type that provides the `title` modifier.
@_documentation(visibility: internal)
public protocol TitleAttribute: Attribute {
@@ -2772,7 +3352,7 @@ public protocol TitleAttribute: Attribute {
/// .title("Lorem ipsum")
/// ```
///
- /// - Parameter value: The extra information to display
+ /// - Parameter value: The extra information to display.
///
/// - Returns: The element
func title(_ value: String) -> Self
@@ -2786,8 +3366,8 @@ public protocol TitleAttribute: Attribute {
/// .title("Lorem ipsum")
/// ```
///
- /// - Parameter localizedKey: The string key to be translated
- /// - Parameter tableName: The translation table to look in
+ /// - Parameter localizedKey: The string key to be translated.
+ /// - Parameter tableName: The translation table to look in.
///
/// - Returns: The element
func title(_ localizedKey: LocalizedStringKey, tableName: String?) -> Self
@@ -2801,7 +3381,7 @@ public protocol TitleAttribute: Attribute {
/// .title(verbatim: "Lorem ipsum")
/// ```
///
- /// - Parameter value: The extra information to display
+ /// - Parameter value: The extra information to display.
///
/// - Returns: The element
func title(verbatim value: String) -> Self
@@ -2829,15 +3409,22 @@ extension TitleAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the translate handler.
+/// A type that provides the `translate` modifier.
@_documentation(visibility: internal)
public protocol TranslateAttribute: Attribute {
- /// The function represents the html-attribute 'translate'.
+ /// Hint the translation behaviour.
///
- /// ```html
- ///
+ /// ```swift
+ /// Paragraph {
+ /// "Lorem ipsum..."
+ /// }
+ /// .translate(.no)
/// ```
+ ///
+ /// - Parameter value: Whether to exclude the content from translation.
+ ///
+ /// - Returns: The element
func translate(_ value: Values.Decision) -> Self
}
@@ -2855,17 +3442,22 @@ extension TranslateAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the type handler.
+/// A type that provides the `type` modifier.
@_documentation(visibility: internal)
public protocol TypeAttribute: Attribute {
associatedtype TypeValue
- /// The function represents the html-attribute 'type'.
+ /// Specify the type of an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .type(.text)
/// ```
+ ///
+ /// - Parameter value: The type to choose from.
+ ///
+ /// - Returns: The element
func type(_ value: TypeValue) -> Self
}
@@ -2883,7 +3475,7 @@ extension TypeAttribute where Self: EmptyNode {
}
}
-/// A type that provides the `useMap` modifier
+/// A type that provides the `useMap` modifier.
@_documentation(visibility: internal)
public protocol UseMapAttribute: Attribute {
@@ -2918,7 +3510,7 @@ extension UseMapAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the value handler.
+/// A type that provides the `value` modifier.
@_documentation(visibility: internal)
public protocol ValueAttribute: Attribute {
@@ -2985,15 +3577,20 @@ extension ValueAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the width handler.
+/// A type that provides the `width` modifier.
@_documentation(visibility: internal)
public protocol WidthAttribute: Attribute {
- /// The function represents the html-attribute 'width'.
+ /// Set the actual width for the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Input()
+ /// .width(200)
/// ```
+ ///
+ /// - Parameter size: The width to constrain the element to.
+ ///
+ /// - Returns: The element
func width(_ size: Int) -> Self
}
@@ -3011,15 +3608,22 @@ extension WidthAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the wrap handler.
+/// A type that provides the `wrap` modifier.
@_documentation(visibility: internal)
public protocol WrapAttribute: Attribute {
- /// The function represents the html-attribute 'wrap'.
+ /// Specifiy how the text in a text area is to be wrapped when submitted in a form.
///
- /// ```html
- ///
+ /// ```swift
+ /// TextArea {
+ /// "Lorem ipsum..."
+ /// }
+ /// .wrap(.soft)
/// ```
+ ///
+ /// - Parameter value: The way to break words accross lines.
+ ///
+ /// - Returns: The element
func wrap(_ value: Values.Wrapping) -> Self
}
@@ -3037,17 +3641,21 @@ extension WrapAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the property handler.
+/// A type that provides the `property` modifier.
@_documentation(visibility: internal)
public protocol PropertyAttribute: Attribute {
- /// The function represents the html-attribute 'property'.
+ /// Add a property for a link preview.
///
- /// ```html
- ///
+ /// ```swift
+ /// Meta()
+ /// .property(.url)
+ /// .content("https://...")
/// ```
///
- /// - Parameter type:
+ /// - Parameter value: The property to describe the purpose.
+ ///
+ /// - Returns: The element
func property(_ value: Values.Graph) -> Self
}
@@ -3065,7 +3673,7 @@ extension PropertyAttribute where Self: EmptyNode {
}
}
-/// A type that provides the `selected` modifier
+/// A type that provides the `selected` modifier.
@_documentation(visibility: internal)
public protocol SelectedAttribute: Attribute {
@@ -3101,16 +3709,23 @@ extension SelectedAttribute where Self: EmptyNode {
}
}
-/// The protocol provides the element with the shadowrootmode handler.
+/// A type that provides the `shadowRootMode` modifier.
@_documentation(visibility: internal)
public protocol ShadowRootModeAttribute: Attribute {
- /// The function represents the html-attribute 'shadowrootmode'.
+ /// Restrict access to the shadow root for the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Template {
+ /// Slot {
+ /// }
+ /// }
+ /// .shadowRootMode(.open)
/// ```
- func shadowRootMode(_ value: Values.Shadow.Mode) -> Self
+ /// - Parameter mode: The mode that controls access.
+ ///
+ /// - Returns: The element
+ func shadowRootMode(_ mode: Values.Shadow.Mode) -> Self
}
extension ShadowRootModeAttribute where Self: ContentNode {
@@ -3120,17 +3735,32 @@ extension ShadowRootModeAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with inhert handler.
+/// A type that provides the `inert` modifier.
@_documentation(visibility: internal)
public protocol InertAttribute: Attribute {
- /// The function represents the html-attribute 'inert'.
+ /// Disable the element and the content of the element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ /// }
+ /// .inert()
/// ```
+ ///
+ /// - Returns: The element
func inert() -> Self
+ /// Disable the element and the content of the element based on a condition.
+ ///
+ /// ```swift
+ /// Division {
+ /// }
+ /// .inert(true)
+ /// ```
+ ///
+ /// - Parameter condition: Whether the element should be disabled.
+ ///
+ /// - Returns: The element
func inert(_ condition: Bool) -> Self
}
@@ -3148,14 +3778,20 @@ extension InertAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `fetchPriority` modifier
@_documentation(visibility: internal)
public protocol FetchPriorityAttribute: Attribute {
- /// The function represents the html-attribute 'shadowrootmode'.
+ /// Set the priority to fetch the resource.
///
- /// ```html
- ///
+ /// ```swift
+ /// Image()
+ /// .fetchPriority(.high)
/// ```
+ ///
+ /// - Parameter value: The priority to take into account.
+ ///
+ /// - Returns: The elemet
func fetchPriority(_ value: Values.Priority) -> Self
}
@@ -3173,14 +3809,21 @@ extension FetchPriorityAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `loading` modifier
@_documentation(visibility: internal)
public protocol LoadingAttribute: Attribute {
- /// The function represents the html-attribute 'loading'.
+ /// Specify the loading behaviour.
///
- /// ```html
- ///
+ /// ```swift
+ /// Image()
+ /// .source("https://...")
+ /// .loading(.lazy)
/// ```
+ ///
+ /// - Parameter value: The loading method to use.
+ ///
+ /// - Returns: The element
func loading(_ value: Values.Loading) -> Self
}
@@ -3198,15 +3841,25 @@ extension LoadingAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `sourceSet` modifier
@_documentation(visibility: internal)
public protocol SourceSetAttribute: Attribute {
- /// The function represents the html-attribute 'loading'.
+ /// Set a source set for a picture element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Picture {
+ /// Source()
+ /// .sourceSet("https://...")
+ /// Source()
+ /// .sourceSet("https://...")
+ /// }
/// ```
- func sourceSet(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url path to load from.
+ ///
+ /// - Returns: The element.
+ func sourceSet(_ url: String) -> Self
}
extension SourceSetAttribute where Self: ContentNode {
@@ -3223,14 +3876,22 @@ extension SourceSetAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `decoding` modifier
@_documentation(visibility: internal)
public protocol DecodingAttribute: Attribute {
- /// The function represents the html-attribute 'decoding'.
+ /// Hint the decoding strategy.
///
- /// ```html
- ///
+ /// ```swift
+ /// Image()
+ /// .source("...jpg")
+ /// .alternate("Lorem ipsum...")
+ /// .decoding(.async)
/// ```
+ ///
+ /// - Parameter value: The strategy to use for the decoding.
+ ///
+ /// - Returns: The element
func decoding(_ value: Values.Decoding) -> Self
}
@@ -3248,14 +3909,22 @@ extension DecodingAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `blocking` modifier
@_documentation(visibility: internal)
public protocol BlockingAttribute: Attribute {
- /// The function represents the html-attribute 'blocking'.
+ /// Announce an element as render blocking.
///
- /// ```html
- ///
+ /// ```swift
+ /// Style {
+ /// "Lorem ipsum..."
+ /// }
+ /// .blocking(.render)
/// ```
+ ///
+ /// - Parameter value: The strategy to use for blocking.
+ ///
+ /// - Returns: The element
func blocking(_ value: Values.Blocking) -> Self
}
@@ -3273,14 +3942,21 @@ extension BlockingAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `popover` modifier
@_documentation(visibility: internal)
public protocol PopoverAttribute: Attribute {
- /// The function represents the html-attribute 'popover'.
+ /// Apply an popover to an element.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ /// }
+ /// .popover(.manual)
/// ```
+ ///
+ /// - Parameter value: The behavior for closing the popover.
+ ///
+ /// - Returns: The element
func popover(_ value: Values.Popover.State) -> Self
}
@@ -3298,15 +3974,27 @@ extension PopoverAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `popoverTarget` modifier
@_documentation(visibility: internal)
public protocol PopoverTargetAttribute: Attribute {
- /// The function represents the html-attribute 'popovertarget'.
+ /// Bind the popover to a target.
///
- /// ```html
- ///
+ /// ```swift
+ /// Division {
+ ///}
+ ///.popover(.manual)
+ ///.id("id")
+ /// Button {
+ /// "Lorem ipsum"
+ /// }
+ /// .popoverTarget("id")
/// ```
- func popoverTarget(_ value: String) -> Self
+ ///
+ /// - Parameter id: The identifier of the target to bind the popover to.
+ ///
+ /// - Returns: The element
+ func popoverTarget(_ id: String) -> Self
}
extension PopoverAttribute where Self: ContentNode {
@@ -3323,15 +4011,24 @@ extension PopoverAttribute where Self: EmptyNode {
}
}
+/// A type that provides the `popoverAction` modifier
@_documentation(visibility: internal)
public protocol PopoverActionAttribute: Attribute {
- /// The function represents the html-attribute 'popovertargetaction'.
+ /// Specify the action for the popover.
///
- /// ```html
- ///
+ /// ```swift
+ /// Button {
+ /// "Lorem ipsum"
+ /// }
+ /// .popoverTarget("id")
+ /// .popoverAction(.hide)
/// ```
- func popoverAction(_ value: Values.Popover.Action) -> Self
+ ///
+ /// - Parameter action: The action to perform when triggered.
+ ///
+ /// - Returns: The element
+ func popoverAction(_ action: Values.Popover.Action) -> Self
}
extension PopoverAttribute where Self: ContentNode {
diff --git a/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
index a3e560bb..12c665cc 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
@@ -1,11 +1,3 @@
-/*
- Abstract:
- The file contains the protocols for the event html-attributes.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
/// The alias combines the global attributes of the event attributes.
diff --git a/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
index 42301767..816637ae 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
@@ -1,27 +1,26 @@
-/*
- Abstract:
- The file contains the protocols for the vector html-attributes.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
/// The alias combines the global attributes of the vector attributes.
@_documentation(visibility: internal)
public typealias GlobalVectorAttributes = IdentifierAttribute & TabulatorAttribute & ClassAttribute & StyleAttribute & FillAttribute & FillOpacityAttribute & StrokeAttribute & StrokeWidthAttribute & StrokeOpacityAttribute & StrokeLineCapAttribute & StrokeLineJoinAttribute
-/// The protocol provides the element with the draw handler.
+/// A type that provides the `draw` modifier.
@_documentation(visibility: internal)
public protocol DrawAttribute: Attribute {
- /// The function represents the html-attribute 'd'.
+ /// Draw a path.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Path {
+ /// }
+ /// .draw("M150...")
+ /// }
/// ```
- func draw(_ value: String) -> Self
+ /// - Parameter path: The path to draw.
+ ///
+ /// - Returns: The element
+ func draw(_ path: String) -> Self
}
extension DrawAttribute where Self: ContentNode {
@@ -31,17 +30,24 @@ extension DrawAttribute where Self: ContentNode {
}
}
-
-/// The protocol provides the element with the fill handler.
+/// A type that provides the `fill` modifier.
@_documentation(visibility: internal)
public protocol FillAttribute: Attribute {
- /// The function represents the html-attribute 'fill'.
+ /// Fill the shape.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .fill("black")
+ /// }
/// ```
- func fill(_ value: String) -> Self
+ ///
+ /// - Parameter color: The color to fill shape with.
+ ///
+ /// - Returns: The element
+ func fill(_ color: String) -> Self
}
extension FillAttribute where Self: ContentNode {
@@ -51,15 +57,23 @@ extension FillAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the fill-opacity handler.
+/// A type that provides the `fillOpacity` modifier.
@_documentation(visibility: internal)
public protocol FillOpacityAttribute: Attribute {
- /// The function represents the html-attribute 'fill-opacity"'.
+ /// Define the opacity of the filling.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .fillOpacity(0.5)
+ /// }
/// ```
+ ///
+ /// - Parameter value: The opacity to apply.
+ ///
+ /// - Returns: The element
func fillOpacity(_ value: Double) -> Self
}
@@ -70,16 +84,24 @@ extension FillOpacityAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the stroke handler.
+/// A type that provides the `stroke` modifier.
@_documentation(visibility: internal)
public protocol StrokeAttribute: Attribute {
- /// The function represents the html-attribute 'stroke'.
+ /// Set the stroke for the shape.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .stroke("#000000")
+ /// }
/// ```
- func stroke(_ value: String) -> Self
+ ///
+ /// - Parameter color: The color to fill the stroke with.
+ ///
+ /// - Returns: The element
+ func stroke(_ color: String) -> Self
}
extension StrokeAttribute where Self: ContentNode {
@@ -89,15 +111,23 @@ extension StrokeAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the stroke-width handler.
+/// A type that provides the `strokeWidth` modifier.
@_documentation(visibility: internal)
public protocol StrokeWidthAttribute: Attribute {
- /// The function represents the html-attribute 'stroke-width'.
+ /// Set the thickness of the stroke.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .strokeWidth(3)
+ /// }
/// ```
+ ///
+ /// - Parameter size: The thickness to apply to the stroke.
+ ///
+ /// - Returns: The element
func strokeWidth(_ size: Int) -> Self
}
@@ -108,15 +138,23 @@ extension StrokeWidthAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the stroke-opacity handler.
+/// A type that provides the `strokeOpacity` modifier.
@_documentation(visibility: internal)
public protocol StrokeOpacityAttribute: Attribute {
- /// The function represents the html-attribute 'stroke-opacity'.
+ /// Set the opacity for the stroke.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Line {
+ /// }
+ /// .strokeOpacity(0.8)
+ /// }
/// ```
+ ///
+ /// - Parameter value: The level to apply to the stroke.
+ ///
+ /// - Returns: The element
func strokeOpacity(_ value: Double) -> Self
}
@@ -127,15 +165,23 @@ extension StrokeOpacityAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the stroke-linecap handler.
+/// A type that provides the `strokeLineCap` modifier.
@_documentation(visibility: internal)
public protocol StrokeLineCapAttribute: Attribute {
- /// The function represents the html-attribute 'stroke-linecap'.
+ /// Set the shape of the stroke end.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Line {
+ /// }
+ /// .strokeLineCap(.butt)
+ /// }
/// ```
+ ///
+ /// - Parameter value: The shape to end the stroke.
+ ///
+ /// - Returns: The element
func strokeLineCap(_ value: Values.Linecap) -> Self
}
@@ -146,15 +192,23 @@ extension StrokeLineCapAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the stroke-linejoin handler.
+/// A type that provides the `strokeLineJoin` modifier.
@_documentation(visibility: internal)
public protocol StrokeLineJoinAttribute: Attribute {
- /// The function represents the html-attribute 'stroke-linejoin'.
+ /// Set the shape of the stroke join.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Line {
+ /// }
+ /// .strokeLineJoin(.miter)
+ /// }
/// ```
+ ///
+ /// - Parameter value: The shape when two lines meet.
+ ///
+ /// - Returns: The element
func strokeLineJoin(_ value: Values.Linejoin) -> Self
}
@@ -165,15 +219,23 @@ extension StrokeLineJoinAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the radius handler.
+/// A type that provides the `radius` modifier.
@_documentation(visibility: internal)
public protocol RadiusAttribute: Attribute {
- /// The function represents the html-attribute 'r'.
+ /// Specify a radius for the circle.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .radius(30)
+ /// }
/// ```
+ ///
+ /// - Parameter size: The size of the radius to apply.
+ ///
+ /// - Returns: The element
func radius(_ size: Int) -> Self
}
@@ -184,15 +246,22 @@ extension RadiusAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the radius handler.
+/// A type that provides the `positionPoint` modifier.
@_documentation(visibility: internal)
public protocol PositionPointAttribute: Attribute {
- /// The function represents the html-attribute 'x' and 'y'.
+ /// Set the position of the shape.
///
- /// ```html
- ///
+ /// ```Swift
+ /// Vector {
+ /// Rectangle {
+ /// }
+ /// .positionPoint((50, 50))
+ /// }
/// ```
+ /// - Parameter point: The coodinates to position the shape.
+ ///
+ /// - Returns: The element
func positionPoint(_ point: (Int, Int)) -> Self
}
@@ -216,15 +285,22 @@ extension PositionPointAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the radius handler.
+/// A type that provides the `radiusPoint` modifier.
@_documentation(visibility: internal)
public protocol RadiusPointAttribute: Attribute {
- /// The function represents the html-attribute 'rx' and 'ry'.
+ /// Apply a corner radius to the shape.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Rectangle {
+ /// }
+ /// .radiusPoint((10, 10))
+ /// }
/// ```
+ /// - Parameter point: The radius to apply to all corners.
+ ///
+ /// - Returns: The element
func radiusPoint(_ point: (Int, Int)) -> Self
}
@@ -248,15 +324,22 @@ extension RadiusPointAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the radius handler.
+/// A type that provides the `centerPoint` modifier.
@_documentation(visibility: internal)
public protocol CenterPointAttribute: Attribute {
- /// The function represents the html-attribute 'cx' and 'cy'.
+ /// Set the center point of the shape.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Circle {
+ /// }
+ /// .centerPoint((50, 50))
+ /// }
/// ```
+ /// - Parameter point: The coordinates to use as the center.
+ ///
+ /// - Returns: The element
func centerPoint(_ point: (Int, Int)) -> Self
}
@@ -280,15 +363,21 @@ extension CenterPointAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the viewbox handler.
+/// A type that provides the `viewBox` modifier.
@_documentation(visibility: internal)
public protocol ViewBoxAttribute: Attribute {
- /// The function represents the html-attribute 'viewbox'.
+ /// Set the view box for the vector.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// }
+ /// .viewBox("0 0 400 200")
/// ```
+ ///
+ /// - Parameter value: The bounds used to define the viewport.
+ ///
+ /// - Returns: The element
func viewBox(_ value: String) -> Self
}
@@ -299,16 +388,22 @@ extension ViewBoxAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the viewbox handler.
+/// A type that provides the `namespace` modifier.
@_documentation(visibility: internal)
public protocol NamespaceAttribute: Attribute {
- /// The function represents the html-attribute 'viewbox'.
+ /// Specify the namespace for the vector.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// }
+ /// .namespace("http://...")
/// ```
- func namespace(_ value: String) -> Self
+ ///
+ /// - Parameter url: The url to refer to
+ ///
+ /// - Returns: The element
+ func namespace(_ url: String) -> Self
}
extension NamespaceAttribute where Self: ContentNode {
@@ -318,15 +413,23 @@ extension NamespaceAttribute where Self: ContentNode {
}
}
-/// The protocol provides the element with the viewbox handler.
+/// A type that provides the `points` modifier.
@_documentation(visibility: internal)
public protocol PointsAttribute: Attribute {
- /// The function represents the html-attribute 'viewbox'.
+ /// Define a list of points.
///
- /// ```html
- ///
+ /// ```swift
+ /// Vector {
+ /// Polyline {
+ /// }
+ /// .points("50, 25, 21...")
+ /// }
/// ```
+ ///
+ /// - Parameter value: The vertices used for the polyline.
+ ///
+ /// - Returns: The element
func points(_ value: String) -> Self
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
index 6eafcb4d..5bac9b4a 100644
--- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
@@ -1,45 +1,70 @@
-/*
- Abstract:
- The file contains the basic html-elements. These elements should be used at first in an html-document.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The element represents a comment output.
+/// An element that represents a comment output.
+///
+/// Use `Comment` to insert a comment with descriptive text.
///
-/// ```html
-///
+/// ```swift
+/// Comment("Lorem ipsum")
/// ```
public struct Comment: CommentNode, GlobalElement {
public var content: String
+ /// Create a comment.
+ ///
+ /// - Parameter content: The text of the comment.
public init(_ content: String) {
self.content = content
}
}
-/// The element represents the document type.
+/// An element that represents a document type.
///
-/// ```html
-///
+/// Use `Document` to declare the type for the document.
+///
+/// ```swift
+/// Document(.html5)
+/// Html {
+/// Head {
+/// }
+/// Body {
+/// }
+/// }
/// ```
public struct Document: DocumentNode, BasicElement {
public var content: String
+ /// Create a document.
+ ///
+ /// - Parameter value: The type to declare.
public init(_ value: Values.Doctype) {
self.content = value.rawValue
}
}
-/// The element represents the document's root element.
+/// An element that represents the page document.
+///
+/// Use `Html` to define the documentās main structure, including child elements for metadata,
+/// body content, and other nested HTML components.
///
-/// ```html
-///
+/// ```swift
+/// Html {
+/// Head {
+/// Title {
+/// "Lorem ipsum..."
+/// }
+/// }
+/// Body {
+/// Header {
+/// }
+/// Main {
+/// }
+/// Footer {
+/// }
+/// }
+/// }
/// ```
public struct Html: ContentNode, BasicElement {
@@ -49,6 +74,9 @@ public struct Html: ContentNode, BasicElement {
internal var content: [HtmlElement]
+ /// Create a html.
+ ///
+ /// - Parameter content: The html's content.
public init(@ContentBuilder content: () -> [HtmlElement]) {
self.content = content()
}
@@ -244,6 +272,14 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
}
}
+/// An element that represents a custom element.
+///
+/// Use `Custom` when an element is not supported by the framework.
+///
+/// ```swift
+/// Custom(name: "lorem-ipsum") {
+/// }
+/// ```
public struct Custom: CustomNode, GlobalElement {
public var name: String
@@ -252,6 +288,11 @@ public struct Custom: CustomNode, GlobalElement {
public var content: [Content]
+ /// Create a custom.
+ ///
+ /// - Parameters:
+ /// - name: The tag to use for the element.
+ /// - content: The custom's content.
public init(name: String, @ContentBuilder content: () -> [Content]) {
self.name = name
diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
index fc4dea0c..5f58dfe1 100644
--- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
@@ -1,377 +1,162 @@
-/*
- Abstract:
- The file contains the body elements. The html-element 'body' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The alias for the element Navigation.
-///
-/// Nav is the official tag and can be used instead of Navigation.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Navigation``.
@_documentation(visibility: internal)
public typealias Nav = Navigation
-/// The alias for the element Heading1.
-///
-/// H1 is the official tag and can be used instead of Heading1.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading1``.
@_documentation(visibility: internal)
public typealias H1 = Heading1
-/// The alias for the element Heading2.
-///
-/// H2 is the official tag and can be used instead of Heading2.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading2``.
@_documentation(visibility: internal)
public typealias H2 = Heading2
-/// The alias for the element Heading3.
-///
-/// H3 is the official tag and can be used instead of Heading3.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading3``.
@_documentation(visibility: internal)
public typealias H3 = Heading3
-/// The alias for the element Heading4.
-///
-/// H4 is the official tag and can be used instead of Heading4.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading4``.
@_documentation(visibility: internal)
public typealias H4 = Heading4
-/// The alias for the element Heading5.
-///
-/// H5 is the official tag and can be used instead of Heading5.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading5``.
@_documentation(visibility: internal)
public typealias H5 = Heading5
-/// The alias for the element Heading6.
-///
-/// H6 is the official tag and can be used instead of Heading6.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Heading6``.
@_documentation(visibility: internal)
public typealias H6 = Heading6
-/// The alias for the element HeadingGroup.
-///
-/// Hgroup is the official tag and can be used instead of HeadingGroup.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``HeadingGroup``.
@_documentation(visibility: internal)
public typealias Hgroup = HeadingGroup
-/// The alias for the element Paragraph.
-///
-/// P is the official tag and can be used instead of Paragraph.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Paragraph``.
@_documentation(visibility: internal)
public typealias P = Paragraph
-/// The alias for the element HorizontalRule.
-///
-/// Hr is the official tag and can be used instead of HorizontalRule.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``HorizontalRule``.
@_documentation(visibility: internal)
public typealias Hr = HorizontalRule
-/// The alias for the element PreformattedText.
-///
-/// Pre is the official tag and can be used instead of PreformattedText.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``PreformattedText``.
@_documentation(visibility: internal)
public typealias Pre = PreformattedText
-/// The alias for the element OrderedList.
-///
-/// Ol is the official tag and can be used instead of OrderedList.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``OrderedList``.
@_documentation(visibility: internal)
public typealias Ol = OrderedList
-/// The alias for the element UnorderedList.
-///
-/// Ul is the official tag and can be used instead of UnorderedList.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``UnorderedList``.
@_documentation(visibility: internal)
public typealias Ul = UnorderedList
-/// The alias for the element DescriptionList.
-///
-/// Dl is the official tag and can be used instead of DescriptionList.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``DescriptionList``.
@_documentation(visibility: internal)
public typealias Dl = DescriptionList
-/// The alias for the element Division.
-///
-/// Div is the official tag and can be used instead of Division.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Division``.
@_documentation(visibility: internal)
public typealias Div = Division
-/// The alias for the element Anchor.
-///
-/// A is the official tag and can be used instead of Anchor.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Anchor``.
@_documentation(visibility: internal)
public typealias A = Anchor
-/// The alias for the element Emphasize.
-///
-/// Em is the official tag and can be used instead of Emphasize.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Emphasize``.
@_documentation(visibility: internal)
public typealias Em = Emphasize
-/// The alias for the element StrikeThrough.
-///
-/// S is the official tag and can be used instead of StrikeThrough.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``StrikeThrough``.
@_documentation(visibility: internal)
public typealias S = StrikeThrough
-/// The alias for the element ShortQuote.
-///
-/// Q is the official tag and can be used instead of ShortQuote.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``ShortQuote``.
@_documentation(visibility: internal)
public typealias Q = ShortQuote
-/// The alias for the element Definition.
-///
-/// Dfn is the official tag and can be used instead of Definition.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Definition``.
@_documentation(visibility: internal)
public typealias Dfn = Definition
-/// The alias for the element Abbreviation.
-///
-/// Abbr is the official tag and can be used instead of Abbreviation.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Abbreviation``.
@_documentation(visibility: internal)
public typealias Abbr = Abbreviation
-/// The alias for the element Variable.
-///
-/// V is the official tag and can be used instead of Variable.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Variable``.
@_documentation(visibility: internal)
public typealias V = Variable
-/// The alias for the element SampleOutput.
-///
-/// Samp is the official tag and can be used instead of SampleOutput.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``SampleOutput``.
@_documentation(visibility: internal)
public typealias Samp = SampleOutput
-/// The alias for the element KeyboardInput.
-///
-/// Kbd is the official tag and can be used instead of KeyboardInput.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``KeyboardInput``.
@_documentation(visibility: internal)
public typealias Kbd = KeyboardInput
-/// The alias for the element Subscript.
-///
-/// Sub is the official tag and can be used instead of Subscript.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Subscript``.
@_documentation(visibility: internal)
public typealias Sub = Subscript
-/// The alias for the element Superscript.
-///
-/// Sup is the official tag and can be used instead of Superscript.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Superscript``.
@_documentation(visibility: internal)
public typealias Sup = Superscript
-/// The alias for the element Italic.
-///
-/// I is the official tag and can be used instead of Italic.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Italic``.
@_documentation(visibility: internal)
public typealias I = Italic
-/// The alias for the element Bold.
-///
-/// Bold is the official tag and can be used instead of Bold.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Bold``.
@_documentation(visibility: internal)
public typealias B = Bold
-/// The alias for the element Underline.
-///
-/// U is the official tag and can be used instead of Underline.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Underline``.
@_documentation(visibility: internal)
public typealias U = Underline
-/// The alias for the element LineBreak.
-///
-/// Br is the official tag and can be used instead of LineBreak.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``LineBreak``.
@_documentation(visibility: internal)
public typealias Br = LineBreak
-/// The alias for the element WordBreak.
-///
-/// Wbr is the official tag and can be used instead of WordBreak.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``WordBreak``.
@_documentation(visibility: internal)
public typealias Wbr = WordBreak
-/// The alias for the element InsertedText.
-///
-/// Ins is the official tag and can be used instead of InsertedText.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``InsertedText``.
@_documentation(visibility: internal)
public typealias Ins = InsertedText
-/// The alias for the element DeletedText.
-///
-/// Del is the official tag and can be used instead of DeletedText.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``DeletedText``.
@_documentation(visibility: internal)
public typealias Del = DeletedText
-/// The alias for the element Image.
-///
-/// Img is the official tag and can be used instead of Image.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Image``.
@_documentation(visibility: internal)
public typealias Img = Image
-/// The alias for the element InlineFrame.
-///
-/// Iframe is the official tag and can be used instead of InlineFrame.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``InlineFrame``.
@_documentation(visibility: internal)
public typealias Iframe = InlineFrame
-/// The alias for the element Vector.
-///
-/// Svg is the official tag and can be used instead of Vector.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``Vector``.
@_documentation(visibility: internal)
public typealias Svg = Vector
-/// The element represents a self-contained content.
+/// An element that represents an article section.
///
-/// ```html
-///
+/// Use `Article` to separate content semantically.
+///
+/// ```swift
+/// Article {
+/// Heading3 {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Article: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -381,6 +166,9 @@ public struct Article: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var content: [Content]
+ /// Create a article.
+ ///
+ /// - Parameter content: The article's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -652,10 +440,19 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents a generic section of the document.
+/// An element that represents a content section.
+///
+/// Use `Section` to part your content in coherent blocks.
///
-/// ```html
-///
+/// ```swift
+/// Section {
+/// Heading2 {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Section: ContentNode, HtmlElement, BodyElement, FigureElement, FormElement, ObjectElement {
@@ -665,6 +462,9 @@ public struct Section: ContentNode, HtmlElement, BodyElement, FigureElement, For
internal var content: [Content]
+ /// Create a section.
+ ///
+ /// - Parameter content: The section's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -936,10 +736,21 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents a section of a page that links to other pages or parts within the page.
+/// An element that represents a page navigation.
///
-/// ```html
-///
+/// Use `Navigation` to provide links that help users browse through the page.
+///
+/// ```swift
+/// Navigation {
+/// OrderedList {
+/// ListItem {
+/// Anchor {
+/// "Lorem ipsum"
+/// }
+/// .reference("#")
+/// }
+/// }
+/// }
/// ```
public struct Navigation: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -949,6 +760,9 @@ public struct Navigation: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var content: [Content]
+ /// Create a navigation.
+ ///
+ /// - Parameter content: The navigation's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -1220,10 +1034,17 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
}
}
-/// The element defines some content aside from the content it is placed in.
+/// An element that defines a content sidebar.
+///
+/// Use `Aside` to define some content aside from the content it is placed in.
///
-/// ```html
-///
+/// ```swift
+/// Body {
+/// Main {
+/// }
+/// Aside {
+/// }
+/// }
/// ```
public struct Aside: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -1233,6 +1054,9 @@ public struct Aside: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var content: [Content]
+ /// Create a aside.
+ ///
+ /// - Parameter content: The aside's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -1504,10 +1328,14 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
///
-/// ```html
-///
+/// Use `Heading1` to define the primary heading on a page or within a ``Section``.
+///
+/// ```swift
+/// Heading1 {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Heading1: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -1517,6 +1345,9 @@ public struct Heading1: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -1795,10 +1626,14 @@ extension Heading1: Localizable {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
+///
+/// Use `Heading2` to introduce sections under ``Heading1``.
///
-/// ```html
-///
+/// ```swift
+/// Heading2 {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Heading2: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -1808,6 +1643,9 @@ public struct Heading2: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -2086,10 +1924,14 @@ extension Heading2: Localizable {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
+///
+/// Use `Heading3` to define a heading under ``Heading2``.
///
-/// ```html
-///
+/// ```swift
+/// Heading3 {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Heading3: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -2099,6 +1941,9 @@ public struct Heading3: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -2377,10 +2222,14 @@ extension Heading3: Localizable {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
+///
+/// Use `Heading4` to define a heading under ``Heading3``.
///
-/// ```html
-///
+/// ```swift
+/// Heading4 {
+/// "Lorem ipsum"
+/// }
/// ```
public struct Heading4: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -2390,6 +2239,9 @@ public struct Heading4: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -2668,10 +2520,14 @@ extension Heading4: Localizable {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
+///
+/// Use `Heading5` to define a heading under ``Heading4``.
///
-/// ```html
-///
+/// ```swift
+/// Heading5 {
+/// "Lorem ipsum"
+/// }
/// ```
public struct Heading5: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -2681,6 +2537,9 @@ public struct Heading5: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -2959,10 +2818,14 @@ extension Heading5: Localizable {
}
}
-/// The element represents a heading.
+/// An element that represents a text heading.
+///
+/// Use `Heading6` to define a heading under the ``Heading5``.
///
-/// ```html
-///
+/// ```swift
+/// Heading6 {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Heading6: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -2972,6 +2835,9 @@ public struct Heading6: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a heading.
+ ///
+ /// - Parameter content: The heading's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -3250,10 +3116,19 @@ extension Heading6: Localizable {
}
}
-/// The element is used to group a set of heading elements.
+/// An element that represents a group container.
+///
+/// Use `HeadingGroup` to group a set of ``Heading1`` to ``Heading6``.
///
-/// ```html
-///
+/// ```swift
+/// HeadingGroup {
+/// Heading1 {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct HeadingGroup: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -3263,6 +3138,9 @@ public struct HeadingGroup: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a heading group.
+ ///
+ /// - Parameter content: The group's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -3534,11 +3412,16 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
}
}
-/// The element represents a header.
+/// An element that represents a page header.
///
-/// ```html
-///
-/// ```
+/// Use `Header` to separate content semantically.
+///
+/// ```swift
+/// Header {
+/// Heading1 {
+/// "Lorem ipsum..."
+/// }
+/// }
public struct Header: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
internal var name: String { "header" }
@@ -3547,6 +3430,9 @@ public struct Header: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create a header.
+ ///
+ /// - Parameter content: The header's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -3818,10 +3704,13 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents a footer.
+/// An element that represents a page footer.
///
-/// ```html
-///
+/// Use `Footer` to separate content semantically.
+///
+/// ```swift
+/// Footer {
+/// }
/// ```
public struct Footer: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -3831,6 +3720,9 @@ public struct Footer: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create a footer.
+ ///
+ /// - Parameter content: The footer's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -4102,10 +3994,20 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents the contact information.
+/// An element that represents an address block.
+///
+/// Use `Address` to associate contact information with the related content.
///
-/// ```html
-///
+/// ```swift
+/// Address {
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// Anchor() {
+/// "Lorem ipsum"
+/// }
+/// .reference("mailto:lorem@ispum.de")
+/// }
/// ```
public struct Address: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -4115,6 +4017,9 @@ public struct Address: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var content: [Content]
+ /// Create an address.
+ ///
+ /// - Parameter content: The address's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -4386,10 +4291,14 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element is used to define a paragraph.
+/// An element that represents a text paragraph.
+///
+/// Use `Paragraph` to group related sentences.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Paragraph: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -4399,6 +4308,9 @@ public struct Paragraph: ContentNode, HtmlElement, BodyElement, FormElement, Fig
internal var content: [Content]
+ /// Create a paragraph.
+ ///
+ /// - Parameter content: The paragraph's content
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -4677,10 +4589,18 @@ extension Paragraph: Localizable {
}
}
-/// The element is used for horizontal rules that act as dividers between sections.
+/// An element that represents a thematic break.
///
-/// ```html
-///
+/// Use `HorizontalRule` to seperate content visually.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// HorizontalRule()
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct HorizontalRule: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -4688,6 +4608,7 @@ public struct HorizontalRule: EmptyNode, HtmlElement, BodyElement, FormElement,
internal var attributes: OrderedDictionary?
+ /// Create a horizontal rule.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -4956,10 +4877,20 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt
}
}
-/// The element represents a block of preformatted text.
+/// An element that represents preformatted text.
+///
+/// Use `PreformattedText` to preserve the formatting of the text.
///
-/// ```html
-///
+/// ```swift
+/// PreformattedText {
+/// Code {
+/// """
+/// if() {
+/// } else {
+/// }
+/// """
+/// }
+/// }
/// ```
public struct PreformattedText: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -4969,6 +4900,9 @@ public struct PreformattedText: ContentNode, HtmlElement, BodyElement, FormEleme
internal var content: [Content]
+ /// Create a preformatted text.
+ ///
+ /// - Parameter content: The text's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -5240,10 +5174,14 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA
}
}
-/// The element represents a section that is quoted from another source.
+/// An element that represents a extended quotation.
+///
+/// Use `Blockquote` to denote a quoted text from another source.
///
-/// ```html
-///
+/// ```swift
+/// Blockquote {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Blockquote: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -5253,6 +5191,9 @@ public struct Blockquote: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var content: [Content]
+ /// Create a block quote.
+ ///
+ /// - Parameter content: The quote's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -5535,10 +5476,19 @@ extension Blockquote: Localizable {
}
}
-/// The element represents a list of items, where the items have been intentionally ordered.
+/// An element that represents a ordered list.
///
-/// ```html
-///
+/// Use `OrderedList` to create a list of ``ListItem`` with an intentional order.
+///
+/// ```swift
+/// OrderedList {
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct OrderedList: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -5548,6 +5498,9 @@ public struct OrderedList: ContentNode, HtmlElement, BodyElement, FormElement, F
internal var content: [ListElement]
+ /// Create a ordered list.
+ ///
+ /// - Parameter content: The list's content.
public init(@ContentBuilder content: () -> [ListElement]) {
self.content = content()
}
@@ -5831,10 +5784,19 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-/// The element represents a list of items, where the order of the items is not important.
+/// An element that represents a unordered list.
+///
+/// Use `UnorderedList` create a list of ``ListItem`` in an unordered manner.
///
-/// ```html
-///
+/// ```swift
+/// UnorderedList {
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct UnorderedList: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -5844,6 +5806,9 @@ public struct UnorderedList: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [ListElement]
+ /// Create a unordered list.
+ ///
+ /// - Parameter content: The list's content.
public init(@ContentBuilder content: () -> [ListElement]) {
self.content = content()
}
@@ -6115,10 +6080,25 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr
}
}
-/// The element represents a list of items, each of represents a command the user can perform.
+/// An element that represents an action menu.
+///
+/// Use `Menu` to provide commands that users can perform.
///
-/// ```html
-///
+/// ```swift
+/// Menu {
+/// ListItem {
+/// Button {
+/// "Save"
+/// }
+/// .on(event: .click, "save()")
+/// }
+/// ListItem {
+/// Button {
+/// "Share"
+/// }
+/// .on(event: .click, "share()")
+/// }
+/// }
/// ```
public struct Menu: ContentNode, HtmlElement, BodyElement {
@@ -6128,6 +6108,9 @@ public struct Menu: ContentNode, HtmlElement, BodyElement {
internal var content: [ListElement]
+ /// Create a menu.
+ ///
+ /// - Parameter content: The menu's content.
public init(@ContentBuilder content: () -> [ListElement]) {
self.content = content()
}
@@ -6303,10 +6286,21 @@ extension Menu: GlobalAttributes {
}
}
-/// The element defines a list of terms and corresponding definitions.
+/// An element that represents a description list.
///
-/// ```html
-///
+/// Use `DescriptionList` to define a list of ``TermName`` and their corresponding ``TermDefinition``.
+///
+/// ```swift
+/// DescriptionList {
+/// ListItem {
+/// TermName {
+/// "Lorem ipsum"
+/// }
+/// TermDefinition {
+/// "Lorem ipsum..."
+/// }
+/// }
+/// }
/// ```
public struct DescriptionList: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -6316,6 +6310,9 @@ public struct DescriptionList: ContentNode, HtmlElement, BodyElement, FormElemen
internal var content: [DescriptionElement]
+ /// Create a description list
+ ///
+ /// - Parameter content: The list's content.
public init(@ContentBuilder content: () -> [DescriptionElement]) {
self.content = content()
}
@@ -6587,10 +6584,19 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt
}
}
-/// The element can thus be used to annotate illustrations, diagrams, photos, code listings.
+/// An element that represents an media figure.
///
-/// ```html
-///
+/// Use `Figure` to wrap content along with a ``FigureCaption`` that describes it.
+///
+/// ```swift
+/// Figure {
+/// Image()
+/// .source(...png)
+/// .alternate("Lorem ipsum...")
+/// FigureCaption {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Figure: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -6600,6 +6606,9 @@ public struct Figure: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [FigureElement]
+ /// Create a figure.
+ ///
+ /// - Parameter content: The figure's content.
public init(@ContentBuilder content: () -> [FigureElement]) {
self.content = content()
}
@@ -6871,10 +6880,16 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents a comment output.
+/// An element that represents a document link.
+///
+/// Use `Anchor` to link to another ressource.
///
-/// ```html
-///
+/// ```swift
+/// Anchor {
+/// "Lorem ipsum..."
+/// }
+/// .reference("https://...")
+/// .target(.blank)
/// ```
public struct Anchor: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -6884,6 +6899,9 @@ public struct Anchor: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create an anchor.
+ ///
+ /// - Parameter content: The anchor's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -7198,10 +7216,18 @@ extension Anchor: Localizable {
}
}
-/// The element provides typographic emphasis.
+/// An element that represents text emphasis.
+///
+/// Use `Emphasize` to signal importance.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// EmphasizeĀ {
+/// "Lorem Ipsum"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Emphasize: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -7211,6 +7237,9 @@ public struct Emphasize: ContentNode, HtmlElement, BodyElement, FormElement, Fig
internal var content: [Content]
+ /// Create a emphasize.
+ ///
+ /// - Parameter content: The emphasize's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -7482,10 +7511,16 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
}
}
-/// The element provides strong typographic emphasis.
+/// An element that represents text emphasis.
///
-/// ```html
-///
+/// Use `Strong` to signal importance.
+///
+/// ```swift
+/// Paragraph {
+/// Strong {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Strong: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -7495,6 +7530,9 @@ public struct Strong: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create a strong.
+ ///
+ /// - Parameter content: The strong's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -7766,10 +7804,16 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents side comments such as small print.
+/// An element that represents text emphasis.
///
-/// ```html
-///
+/// Use `Small` to represent small print.
+///
+/// ```swift
+/// Paragraph {
+/// Small {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Small: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -7779,6 +7823,9 @@ public struct Small: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var content: [Content]
+ /// Create a small.
+ ///
+ /// - Parameter content: The small's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -8057,10 +8104,16 @@ extension Small: Localizable {
}
}
-/// The element represents contents that are no longer accurate or no longer relevant.
+/// An element that represents a text emphasis.
+///
+/// Use `StrikeThrough` to emphasize content that is no longer accurate or relevant.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// StrikeThrough {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct StrikeThrough: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -8070,6 +8123,9 @@ public struct StrikeThrough: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a strike through.
+ ///
+ /// - Parameter content: The strike through's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -8272,10 +8328,24 @@ extension StrikeThrough: Localizable {
}
}
-/// The element represents the dominant contents of the document.
+/// An element that represents the document core.
///
-/// ```html
-///
+/// Use `Main` to encapsulate the primary content, distinct from other content
+/// like ``Navigation``, ``Header`` or ``Footer``.
+///
+/// ```swift
+/// Html {
+/// Body {
+/// Header {
+/// }
+/// NavigationĀ {
+/// }
+/// Main {
+/// }
+/// Footer {
+/// }
+/// }
+/// }
/// ```
public struct Main: ContentNode, HtmlElement, BodyElement, FormElement {
@@ -8285,6 +8355,9 @@ public struct Main: ContentNode, HtmlElement, BodyElement, FormElement {
internal var content: [Content]
+ /// Create a main.
+ ///
+ /// - Parameter content: The main's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -8556,10 +8629,21 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents a part that contains a set of controls to performing a search.
+/// An element that represents a group container.
+///
+/// Use `Search` to group a set of controls to perform a search.
///
-/// ```html
-///
+/// ```swift
+/// Search {
+/// Form {
+/// Input()
+/// .name("lorem")
+/// Button {
+/// "Lorem ipsum"
+/// }
+/// .type(.submit)
+/// }
+/// }
/// ```
public struct Search: ContentNode, HtmlElement, BodyElement {
@@ -8569,6 +8653,9 @@ public struct Search: ContentNode, HtmlElement, BodyElement {
internal var content: [Content]
+ /// Create a search.
+ ///
+ /// - Parameter content: The search's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -8744,10 +8831,14 @@ extension Search: GlobalAttributes {
}
}
-/// The element is used to represent different kinds of containers.
+/// An element that represents a generic container.
+///
+/// Use `Division`as a universal container when no other semantic element
+/// is suitable.
///
-/// ```html
-///
+/// ```swift
+/// Division {
+/// }
/// ```
public struct Division: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -8757,6 +8848,10 @@ public struct Division: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a division.
+ ///
+ /// - Parameters:
+ /// - content: The division's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -9028,10 +9123,19 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element represents a comment output.
+/// An element that represents a term definition.
+///
+/// Use `Definition` in conjunction with explanatory text, that provides its definition.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Definition {
+/// "Lrm"
+/// }
+/// .id("lorem")
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Definition: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -9041,6 +9145,9 @@ public struct Definition: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var content: [Content]
+ /// Create a definition.
+ ///
+ /// - Parameter content: The definition's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -9312,10 +9419,17 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
}
}
-/// The element specifies a citation.
+/// An element that represents the work title.
///
-/// ```html
-///
+/// Use `Cite` to mark the title of a work within a citation.
+///
+/// ```swift
+/// Paragraph {
+/// Cite {
+/// "Lorem ipsum"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Cite: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -9325,6 +9439,9 @@ public struct Cite: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var content: [Content]
+ /// Create a cite.
+ ///
+ /// - Parameter content: The cite's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -9596,10 +9713,16 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element is used for a short quotation.
+/// An element that represents a short quotation.
+///
+/// Use `ShortQuote` to denote a quoted text from another source.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// ShortQuote {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct ShortQuote: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -9609,6 +9732,9 @@ public struct ShortQuote: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var content: [Content]
+ /// Create a short quote.
+ ///
+ /// - Parameter content: The quote's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -9884,10 +10010,17 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
}
}
-/// The element represents an abbreviation or acronym.
+/// A element that represents text abbreviation.
+///
+/// Use `Abbreviation` to define an abbreviation or an acronym.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// Abbreviation {
+/// "HTML"
+/// }
+/// .title("Hypertext Markup Language")
+/// }
/// ```
public struct Abbreviation: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -9897,6 +10030,9 @@ public struct Abbreviation: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a abbreviation
+ ///
+ /// - Parameter content: The abbreviation's content
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -10168,10 +10304,17 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
}
}
-/// The element allows one or more spans of phrasing content to be marked with ruby annotations.
+/// An element that represents a phonetic guide.
+///
+/// Use `Ruby` to provide a phonetic reading for a base character.
///
-/// ```html
-///
+/// ```swift
+/// Ruby {
+/// "ę¹"
+/// RubyText {
+/// "ćć"
+/// }
+/// }
/// ```
public struct Ruby: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -10181,6 +10324,9 @@ public struct Ruby: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var content: [RubyElement]
+ /// Create a ruby.
+ ///
+ /// - Parameter content: The ruby's content.
public init(@ContentBuilder content: () -> [RubyElement]) {
self.content = content()
}
@@ -10452,10 +10598,19 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents a comment output.
+/// An element that represents data context.
///
-/// ```html
-///
+/// Use `Data` to enrich your content with structured data.
+///
+/// ```swift
+/// UnorderedList {
+/// ListItem {
+/// Data {
+/// "Lorem ipsum"
+/// }
+/// .value("1337")
+/// }
+/// }
/// ```
public struct Data: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -10464,7 +10619,10 @@ public struct Data: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a data.
+ ///
+ /// - Parameter content: The data's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -10749,10 +10907,18 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V
}
}
-/// The element represents its contents, along with a machine-readable form of those contents in the datetime attribute.
+/// An element that represents a specific period in time.
+///
+/// Use `Time` to present dates and times in a machine-readable format.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Time {
+/// "Lorem ipsum"
+/// }
+/// .dateTime("...")
+/// }
/// ```
public struct Time: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -10761,7 +10927,10 @@ public struct Time: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a time.
+ ///
+ /// - Parameter content: The time's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -11037,10 +11206,18 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D
}
}
-/// The element represents an example of code.
+/// An element that represents text emphasis.
///
-/// ```html
-///
+/// Use `Code` to style text as code.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Code {
+/// "Lorem"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Code: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -11050,6 +11227,9 @@ public struct Code: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var content: [Content]
+ /// Create a code.
+ ///
+ /// - Parameter content: The code's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -11323,8 +11503,7 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
/// The element represents a variable.
///
-/// Use `Variable` to denote a value that can change or vary, typically in mathematical expressions
-/// or programming contexts.
+/// Use `Variable` to denote a value that can change or vary.
///
/// ```swift
/// Paragraph {
@@ -11343,7 +11522,7 @@ public struct Variable: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
- /// Create a variable
+ /// Create a variable.
///
/// - Parameter content: The variable's content.
public init(@ContentBuilder content: () -> [Content]) {
@@ -11617,10 +11796,14 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element represents sample or quoted output from another program or computing system.
+/// An element that represents text emphasis.
///
-/// ```html
-///
+/// Use `SampleOutput` to denote computer output.
+///
+/// ```swift
+/// SampleOutput {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct SampleOutput: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -11630,6 +11813,9 @@ public struct SampleOutput: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a sample output.
+ ///
+ /// - Parameter content: The output's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -11901,10 +12087,18 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
}
}
-/// The element represents user input.
+/// An element that represents text emphasis.
+///
+/// Use `KeyboardInput` to denote user input.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// KeyboardInput {
+/// "Cmd"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct KeyboardInput: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -11914,6 +12108,9 @@ public struct KeyboardInput: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a keyboard input.
+ ///
+ /// - Parameter content: The input's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -12185,10 +12382,18 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr
}
}
-/// The element represents a subscript.
+/// The element represents a subscript text.
+///
+/// Use `Subscript` to display text slightly blow the baseline.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Subscript {
+/// "Lorem ipsum"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Subscript: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -12198,6 +12403,9 @@ public struct Subscript: ContentNode, HtmlElement, BodyElement, FormElement, Fig
internal var content: [Content]
+ /// Createa a subscript.
+ ///
+ /// - Parameter content: The subscript's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -12468,10 +12676,18 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
}
}
-/// The element represents a superscript.
+/// An element that represents a superscript text.
+///
+/// Use `Superscript` to display text slightly above the baseline.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Superscript {
+/// "Lorem ipsum"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Superscript: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -12481,6 +12697,9 @@ public struct Superscript: ContentNode, HtmlElement, BodyElement, FormElement, F
internal var content: [Content]
+ /// Create a superscript.
+ ///
+ /// - Parameter content: The superscript's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -12752,10 +12971,18 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-/// The element represents an italic font text.
+/// An element that represents a text emphasis.
+///
+/// Use `Italic` to style some text italic.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Italic {
+/// "Lorem ipsum"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Italic: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -12765,6 +12992,9 @@ public struct Italic: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create a italic.
+ ///
+ /// - Parameter content: The italic's content
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -13043,10 +13273,18 @@ extension Italic: Localizable {
}
}
-/// The element represents an bold font text.
+/// An element that represents a text emphasis.
+///
+/// Use `Italic` to style some text bold.
///
-/// ```html
-///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Bold {
+/// "Lorem ipsum..."
+/// }
+/// "Lorem ipsum...
+/// }
/// ```
public struct Bold: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -13056,6 +13294,9 @@ public struct Bold: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var content: [Content]
+ /// Create a bold.
+ ///
+ /// - Parameter content: The bold's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -13334,10 +13575,18 @@ extension Bold: Localizable {
}
}
-/// The element specifies that the enclosed text should be displayed as underlined.
+/// An element that represents a text emphasis.
///
-/// ```html
-///
+/// Use `Underline` to underline text.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Underline {
+/// "Lorem ipsum..."
+/// }
+/// "Lorem ipsum...
+/// }
/// ```
public struct Underline: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -13346,7 +13595,10 @@ public struct Underline: ContentNode, HtmlElement, BodyElement, FormElement, Fig
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a underline.
+ ///
+ /// - Parameter content: The underline's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -13625,10 +13877,18 @@ extension Underline: Localizable {
}
}
-/// The element represents a run of text in the document marked or highlighted for reference purposes.
+/// An element that represents a highlighted text.
+///
+/// Use `Mark` to highlight portions of a text.
///
-/// ```html
-///
+/// ```swift
+/// Blockquote {
+/// "Lorem ipsum..."
+/// Mark {
+/// "Lorem ipsum..."
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Mark: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -13637,7 +13897,10 @@ public struct Mark: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a mark.
+ ///
+ /// - Parameter content: The mark's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -13909,10 +14172,18 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents a span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting.
+/// An element that represents text format.
///
-/// ```html
-///
+/// Use `Bdi` to preserve the direction of the text.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Bdi {
+/// "Lorem"
+/// }
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Bdi: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -13922,6 +14193,9 @@ public struct Bdi: ContentNode, HtmlElement, BodyElement, FormElement, FigureEle
internal var content: [Content]
+ /// Create a bidirectional isolate.
+ ///
+ /// - Parameter content: The isolate's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -14193,10 +14467,19 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents explicit text directionality formatting control.
+/// An element that represents a text format.
///
-/// ```html
-///
+/// Use `Bdo` to override the direction of the text.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// Bdo {
+/// "Lorem"
+/// }
+/// .direction(.rightToLeft)
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Bdo: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -14204,6 +14487,7 @@ public struct Bdo: EmptyNode, HtmlElement, BodyElement, FormElement, FigureEleme
internal var attributes: OrderedDictionary?
+ /// Create a bidirectional override.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -14472,10 +14756,14 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element doesn't mean anything on its own.
+/// An element that represents a group container.
+///
+/// Use `Span` to group content.
///
-/// ```html
-///
+/// ```swift
+/// Span {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct Span: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -14485,6 +14773,9 @@ public struct Span: ContentNode, HtmlElement, BodyElement, FormElement, FigureEl
internal var content: [Content]
+ /// Create a span.
+ ///
+ /// - Parameter content: The span's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -14756,17 +15047,20 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-/// The element represents a line break.
+/// An element that represents a line break.
///
-/// ```html
-///
+/// Use `LineBreak` to move text to a new line.
+///
+/// ```swift
+/// LineBreak()
/// ```
public struct LineBreak: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
internal var name: String { "br" }
internal var attributes: OrderedDictionary?
-
+
+ /// Create a line break.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -15035,10 +15329,16 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
}
}
-/// The element represents a line break opportunity.
+/// An element that represents a line break.
///
-/// ```html
-///
+/// Use `WordBreak` to suggest a break opportunity to wrap text onto a new line if needed.
+///
+/// ```swift
+/// Paragraph {
+/// "Lorem ipsum..."
+/// WordBreak()
+/// "Lorem ipsum..."
+/// }
/// ```
public struct WordBreak: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -15046,6 +15346,7 @@ public struct WordBreak: EmptyNode, HtmlElement, BodyElement, FormElement, Figur
internal var attributes: OrderedDictionary?
+ /// Create a word break.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -15314,10 +15615,14 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
}
}
-/// The element represents an addition to the document.
+/// An element that represents a text emphasis.
///
-/// ```html
-///
+/// Use `InsertedText` to display text as an addition.
+///
+/// ```swift
+/// InsertedText {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct InsertedText: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -15327,6 +15632,9 @@ public struct InsertedText: ContentNode, HtmlElement, BodyElement, FormElement,
internal var content: [Content]
+ /// Create a inserted text.
+ ///
+ /// - Parameter content: The text's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -15606,10 +15914,14 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
}
}
-/// The element represents a removal from the document.
+/// An element that represents a text emphasis.
+///
+/// Use `DeletedText` to display text as a deletion.
///
-/// ```html
-///
+/// ```swift
+/// DeletedText {
+/// "Lorem ipsum..."
+/// }
/// ```
public struct DeletedText: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -15619,6 +15931,9 @@ public struct DeletedText: ContentNode, HtmlElement, BodyElement, FormElement, F
internal var content: [Content]
+ /// Create a deleted text.
+ ///
+ /// - Parameter content: The text's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -15898,10 +16213,19 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-/// The element is a container which provides multiple sources to its contained image element.
+/// An element that represents an media figure.
///
-/// ```html
-///
+/// Use `Picture` to provide multiple ``Source`` to its contained ``Image``.
+///
+/// ```swift
+/// Picture {
+/// Source()
+/// .sourceSet("...jpg")
+/// .media("(orientation: portrait)"
+/// Image()
+/// .source("...jpg")
+/// .alternate("Lorem ipsum..."
+/// }
/// ```
public struct Picture: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -15911,6 +16235,9 @@ public struct Picture: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var content: [Content]
+ /// Create a picture.
+ ///
+ /// - Parameter content: The picture's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -16106,10 +16433,15 @@ extension Picture: GlobalAttributes, GlobalEventAttributes {
}
}
-/// The element represents an image.
+/// An element that represents an image embed.
+///
+/// Use `Image` to display an image alongside content.
+///
+/// ```swift
+/// Image()
+/// .source("...png")
+/// .alt("Lorem ipsum...")
///
-/// ```html
-///
/// ```
public struct Image: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -16117,6 +16449,7 @@ public struct Image: EmptyNode, HtmlElement, BodyElement, FormElement, FigureEle
internal var attributes: OrderedDictionary?
+ /// Create an image.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -16446,10 +16779,15 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents its nested browsing context.
+/// An element that represents a content embed.
+///
+/// Use `InlineFrame` to place external content within yours.
///
-/// ```html
-///
+/// ```swift
+/// InlineFrame {
+/// }
+/// .source("https://...")
+/// .title("Lorem ipsum")
/// ```
public struct InlineFrame: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -16459,6 +16797,9 @@ public struct InlineFrame: ContentNode, HtmlElement, BodyElement, FormElement, F
internal var content: [Content]
+ /// Create a inline frame.
+ ///
+ /// - Parameter content: The frame's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -16770,10 +17111,14 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-/// The element provides an integration point for an external application or interactive content.
+/// An element that represents an object embed.
+///
+/// Use `Embed` to embed external content into the document.
///
-/// ```html
-///
+/// ```swift
+/// Embed()
+/// .source("...html")
+/// .type(".html")
/// ```
public struct Embed: EmptyNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -16781,6 +17126,7 @@ public struct Embed: EmptyNode, HtmlElement, BodyElement, FormElement, FigureEle
internal var attributes: OrderedDictionary?
+ /// Create an embed.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -17069,10 +17415,15 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents an external resource.
+/// An element that represents an object embed.
+///
+/// Use `Object` to embed external content into the document.
///
-/// ```html
-///
+/// ```swift
+/// Object {
+/// }
+/// .data("...html")
+/// .type(.html")
/// ```
public struct Object: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -17082,6 +17433,9 @@ public struct Object: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [ObjectElement]
+ /// Create a object.
+ ///
+ /// - Parameter content: The object's content.
public init(@ContentBuilder content: () -> [ObjectElement]) {
self.content = content()
}
@@ -17377,10 +17731,16 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element is used to embed video content in a document.
+/// An element that represents a video embed.
+///
+/// Use `Video` to embed and play video content.
///
-/// ```html
-///
+/// ```swift
+/// Video {
+/// Source()
+/// .source("...mp4")
+/// .type(.mp4)
+/// }
/// ```
public struct Video: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -17390,6 +17750,9 @@ public struct Video: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var content: [MediaElement]
+ /// Create a video.
+ ///
+ /// - Parameter content: The video's content.
public init(@ContentBuilder content: () -> [MediaElement]) {
self.content = content()
}
@@ -17720,10 +18083,16 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element is used to embed audio content in a document.
+/// An element that represents an audio embed.
+///
+/// Use `Audio` to embed and play audio content.
///
-/// ```html
-///
+/// ```swift
+/// Audio {
+/// Source()
+/// .source("...mp4")
+/// .type(".mp4")
+/// }
/// ```
public struct Audio: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -17733,6 +18102,9 @@ public struct Audio: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var content: [MediaElement]
+ /// Create an audio.
+ ///
+ /// - Parameter content: The audio's content.
public init(@ContentBuilder content: () -> [MediaElement]) {
self.content = content()
}
@@ -18046,10 +18418,22 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element is used to define a image map.
+/// An element that represents an image map.
+///
+/// Use `Map` to group map areas for an associated ``Image``.
///
-/// ```html
-///
+/// ```swift
+/// Image()
+/// .source(...png)
+/// .useMap("lorem")
+/// Map {
+/// Area()
+/// .shape(.circle)
+/// .coordinates(10, 10, 10 ,10)
+/// .alternate("Lorem ipsum...")
+/// .reference("https://...")
+/// }
+/// .name("lorem")
/// ```
public struct Map: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -18058,7 +18442,10 @@ public struct Map: ContentNode, HtmlElement, BodyElement, FormElement, FigureEle
internal var attributes: OrderedDictionary?
internal var content: [MapElement]
-
+
+ /// Create a map.
+ ///
+ /// - Parameter content: The map's content.
public init(@ContentBuilder content: () -> [MapElement]) {
self.content = content()
}
@@ -18258,10 +18645,20 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute {
}
}
-/// The element is used as a container for all the form elements.
+/// An element that represents a form container.
+///
+/// Use `Form` to perform form submission and validation.
///
-/// ```html
-///
+/// ```swift
+/// Form {
+/// Input()
+/// .name("lorem")
+/// .value("lorem")
+/// .type(.text)
+/// Button()
+/// .type(.submit)
+/// }
+/// .method(.post)
/// ```
public struct Form: ContentNode, HtmlElement, BodyElement, FigureElement, ObjectElement {
@@ -18271,6 +18668,9 @@ public struct Form: ContentNode, HtmlElement, BodyElement, FigureElement, Object
internal var content: [FormElement]
+ /// Create a form.
+ ///
+ /// - Parameter content: The form's content.
public init(@ContentBuilder content: () -> [FormElement]) {
self.content = content()
}
@@ -18584,10 +18984,21 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A
}
}
-/// The element represents a set of options.
+/// An element that defines a set of predefined options.
+///
+/// Use `DataList` to provide an autocomplete feature for input elements. Users will
+/// see the list of options as they input data.
///
-/// ```html
-///
+/// ```swift
+/// Input()
+/// .list("lorem")
+/// DataList {
+/// Option()
+/// .value("lorem")
+/// Option()
+/// .value("lorem")
+/// }
+/// .id("lorem)
/// ```
public struct DataList: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -18597,6 +19008,9 @@ public struct DataList: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a data list.
+ ///
+ /// - Parameter content: The list's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -18868,10 +19282,16 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element represents the result of a calculation.
+/// An element that represents a calculation result.
+///
+/// Use `Output` to print out the result of the calculation.
///
-/// ```html
-///
+/// ```swift
+/// Form {
+/// Input()
+/// Output {
+/// }
+/// }
/// ```
public struct Output: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -18881,6 +19301,9 @@ public struct Output: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var content: [Content]
+ /// Create a output.
+ ///
+ /// - Parameter content: The output's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -19164,10 +19587,16 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents the completion progress of a task.
+/// An element that displays the progress of a task.
///
-/// ```html
-///
+/// Use `Progress` to indicate and observe task progress.
+///
+/// ```swift
+/// Progress {
+/// "Lorem ipsum"
+/// }
+/// .value(50)
+/// .maximum(100)
/// ```
public struct Progress: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -19177,6 +19606,9 @@ public struct Progress: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var content: [Content]
+ /// Create a progress.
+ ///
+ /// - Parameter content: The progress's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -19465,10 +19897,18 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element represents a scalar measurement within a known range, or a fractional value.
+/// An element that represents a level meter.
///
-/// ```html
-///
+/// Use `Meter` to represent a value within a bounded range.
+///
+/// ```swift
+/// Meter {
+/// "Lorem ipsum"
+/// }
+/// .minimum(0)
+/// .maximum(100)
+/// .low(25)
+/// .high(75)
/// ```
public struct Meter: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -19478,6 +19918,9 @@ public struct Meter: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var content: [Content]
+ /// Create a meter.
+ ///
+ /// - Parameter content: The meter's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -19782,10 +20225,19 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents a disclosure widget from which the user can obtain additional information or controls.
+/// An element that represents a disclosure control.
///
-/// ```html
-///
+/// Use `Details` to toggle visibility of content.
+///
+/// ```swift
+/// Details {
+/// Summary {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Details: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -19795,6 +20247,9 @@ public struct Details: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var content: [Content]
+ /// Create a details.
+ ///
+ /// - Parameter content: The details's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -20074,7 +20529,20 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element defines a dialog box or window.
+/// An element that represents a dialog window.
+///
+/// Use `Dialog` to overlay content that requires focus.
+///
+/// ```swift
+/// Dialog {
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// Button {
+/// "Close"
+/// }
+/// }
+/// ```
public struct Dialog: ContentNode, BodyElement {
internal var name: String { "dialog" }
@@ -20082,7 +20550,10 @@ public struct Dialog: ContentNode, BodyElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a dialog.
+ ///
+ /// - Parameter content: The dialog's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -20358,10 +20829,14 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element allows to include dynamic script and data blocks in a document.
+/// An element that represents executable code.
///
-/// ```html
-///
+/// Use `Script` to embed or refer to exectuable code.
+///
+/// ```swift
+/// Script {
+/// "const foo = 'bar';"
+/// }
/// ```
public struct Script: ContentNode, HeadElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -20371,6 +20846,9 @@ public struct Script: ContentNode, HeadElement, BodyElement, FormElement, Figure
internal var content: [String]
+ /// Create a script.
+ ///
+ /// - Parameter content: The script's content.
public init(@ContentBuilder content: () -> [String]) {
self.content = content()
}
@@ -20594,10 +21072,16 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu
}
}
-/// The element represents a caption for the rest of the contents of a fieldset.
+/// An element that represents content fallback.
///
-/// ```html
-///
+/// Use `NoScript` to define alternate content when scripts are disabled.
+///
+/// ```swift
+/// NoScript {
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct NoScript: ContentNode, HtmlElement, HeadElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -20607,6 +21091,9 @@ public struct NoScript: ContentNode, HtmlElement, HeadElement, BodyElement, Form
internal var content: [Content]
+ /// Create a no script.
+ ///
+ /// - Parameter content: The script's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -20802,10 +21289,21 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes {
}
}
-/// The element is used to declare fragments of HTML that can be cloned and inserted in the document by script.
+/// An element that represents a shadow method.
+///
+/// Use `Template` to replicate the content in multiple places.
///
-/// ```html
-///
+/// ```swift
+/// Template {
+/// Division {
+/// Heading1 {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
+/// }
/// ```
public struct Template: ContentNode, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -20814,7 +21312,10 @@ public struct Template: ContentNode, BodyElement, FormElement, FigureElement, Ob
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a template.
+ ///
+ /// - Parameter content: The template's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -21014,10 +21515,13 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri
}
}
-/// The element represents a comment output.
+/// An element that represents a canvas board.
///
-/// ```html
-///
+/// Use `Canvas` to create a drawable area.
+///
+/// ```swift
+/// Canvas {
+/// }
/// ```
public struct Canvas: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -21306,10 +21810,21 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents a comment output.
+/// An element that represents a data table
+///
+/// Use `Table` to present structured data.
///
-/// ```html
-///
+/// ```swift
+/// Table {
+/// TableRow {
+/// DataCell {
+/// "Lorem ipsum"
+/// }
+/// DataCell {
+/// "Lorem ipsum"
+/// }
+/// }
+/// }
/// ```
public struct Table: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -21318,7 +21833,10 @@ public struct Table: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var attributes: OrderedDictionary?
internal var content: [TableElement]
-
+
+ /// Create a table.
+ ///
+ /// - Parameter content: The table's content.
public init(@ContentBuilder content: () -> [TableElement]) {
self.content = content()
}
@@ -21598,10 +22116,20 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents a vector.
+/// An element that represents a vector graphic.
///
-/// ```html
-///
+/// Use `Vector` to create a drawable area.
+///
+/// ```swift
+/// Vector {
+/// Path {
+/// }
+/// .draw("M...")
+/// }
+/// .namespace("http://...")
+/// .width(200)
+/// .height(100)
+/// .viewBox("0 0 200 100")
/// ```
public struct Vector: ContentNode, HtmlElement, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -21610,7 +22138,10 @@ public struct Vector: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var attributes: OrderedDictionary?
internal var content: [VectorElement]
-
+
+ /// Create a vector.
+ ///
+ /// - Parameter content: The vector's content.
public init(@ContentBuilder content: () -> [VectorElement]) {
self.content = content()
}
@@ -21706,10 +22237,24 @@ extension Vector: GlobalVectorAttributes, WidthAttribute, HeightAttribute, ViewB
}
}
-/// The element is typically used in a shadow tree. Its tend to be a placeholder that you can fill with another markup.
+/// An element that represents a shadow method.
+///
+/// Use `Slot` as placeholder for replacement content.
///
-/// ```html
-///
+/// ```swift
+/// Template {
+/// Division {
+/// Slot {
+/// }
+/// .name("lorem")
+/// }
+/// }
+/// Custom {
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// .slot("lorem")
+/// }
/// ```
public struct Slot: ContentNode, BodyElement, FormElement, FigureElement, ObjectElement {
@@ -21719,6 +22264,9 @@ public struct Slot: ContentNode, BodyElement, FormElement, FigureElement, Object
internal var content: [Content]
+ /// Create a slot.
+ ///
+ /// - Parameter content: The slot's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift
index 8e28e6d6..b5073300 100644
--- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift
@@ -1,37 +1,26 @@
-/*
- Abstract:
- The file contains the definition elements. The html-element 'description' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The alias for the element TermName.
-///
-/// Dt is the official tag and can be used instead of TermName.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``TermName``.
@_documentation(visibility: internal)
public typealias Dt = TermName
-/// The alias for the element TermDefinition.
-///
-/// Dd is the official tag and can be used instead of TermDefinition.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``TermDefinition``.
@_documentation(visibility: internal)
public typealias Dd = TermDefinition
-/// The element specifies a term name.
+/// An element that represents a term name.
///
-/// ```html
-///
+/// Use `TermName` to label a term and to introduce the corresponding definition.
+///
+/// ```swift
+/// DescriptionList {
+/// TermName {
+/// "Lorem ipsum"
+/// }
+/// TermDefinition {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct TermName: ContentNode, DescriptionElement {
@@ -40,7 +29,10 @@ public struct TermName: ContentNode, DescriptionElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a term name.
+ ///
+ /// - Parameter content: The name's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -312,10 +304,19 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element specifies a term definition.
+/// An element that represents a term definition.
///
-/// ```html
-///
+/// Use `TermDefinition` to describe the term in more detail.
+///
+/// ```swift
+/// DescriptionList {
+/// TermName {
+/// "Lorem ipsum"
+/// }
+/// TermDefinition {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct TermDefinition: ContentNode, DescriptionElement {
@@ -324,7 +325,10 @@ public struct TermDefinition: ContentNode, DescriptionElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Creates a term definition.
+ ///
+ /// - Parameter content: The definition's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift
index c2014e4b..eb824680 100644
--- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift
@@ -1,27 +1,22 @@
-/*
- Abstract:
- The file contains the figure elements. The html-element 'figure' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The alias for the element FigureCaption.
-///
-/// Figcaption is the official tag and can be used instead of FigureCaption.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``FigureCaption``.
@_documentation(visibility: internal)
public typealias Figcaption = FigureCaption
-/// The element is used to label a figure.
+/// An element that represents a figure caption.
///
-/// ```html
-///
+/// Use `FigureCaption` to annotate ``Image``, ``Video``, ``Code`` or ``Vector``.
+///
+/// ```swift
+/// Figure {
+/// Image()
+/// .source(...png)
+/// .alternate("Lorem ipsum...")
+/// FigureCaption {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct FigureCaption: ContentNode, FigureElement {
@@ -30,7 +25,10 @@ public struct FigureCaption: ContentNode, FigureElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a figure caption.
+ ///
+ /// - Parameter content: The caption's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift
index aac548e2..f625d0cc 100644
--- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift
@@ -1,17 +1,17 @@
-/*
- Abstract:
- The file contains the form elements. The html-element 'form' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The element represents a typed data field to allow the user to edit the data.
+/// An element that represents a text control.
+///
+/// Use `Input` to collect text input.
///
-/// ```html
-///
+/// ```swift
+/// Form {
+/// Input()
+/// .type(.text)
+/// .name("lorem")
+/// .id("lorem")
+/// }
+/// .method(.post)
/// ```
public struct Input: EmptyNode, FormElement {
@@ -19,6 +19,7 @@ public struct Input: EmptyNode, FormElement {
internal var attributes: OrderedDictionary?
+ /// Create an input.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -400,10 +401,18 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter
}
}
-/// The element represents a caption for a form control.
+/// An element that represents a control label.
///
-/// ```html
-///
+/// Use `Label` to improve the accessibility by associating descriptive text with the controls.
+///
+/// ```swift
+/// Label {
+/// "Lorem ipsum"
+/// }
+/// .for("lorem")
+/// Input()
+/// .id("lorem")
+/// .name("lorem")
/// ```
public struct Label: ContentNode, FormElement {
@@ -413,6 +422,9 @@ public struct Label: ContentNode, FormElement {
internal var content: [Content]
+ /// Create a label.
+ ///
+ /// - Parameter content: The label's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -695,10 +707,23 @@ extension Label: Localizable {
}
}
-/// The element represents a control for selecting amongst a set of options.
+/// An element that represents an option list.
+///
+/// Use `Select` to present a set of ``Option``.
///
-/// ```html
-///
+/// ```swift
+/// Select {
+/// Option {
+/// "Lorem"
+/// }
+/// .value("lorem")
+/// Option {
+/// "Lorem"
+/// }
+/// .value("lorem")
+/// }
+/// .name("lorem")
+/// .id("lorem")
/// ```
public struct Select: ContentNode, FormElement {
@@ -707,7 +732,10 @@ public struct Select: ContentNode, FormElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a select.
+ ///
+ /// - Parameter content: The select's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -963,10 +991,16 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute
}
}
-/// The element represents a multiline plain text edit control.
+/// An element that represents a text control.
///
-/// ```html
-///
+/// Use `TextArea` to collect multiline text input.
+///
+/// ```swift
+/// TextArea {
+/// "Lorem ipsum..."
+/// }
+/// .name("lorem")
+/// .id("lorem")
/// ```
public struct TextArea: ContentNode, FormElement {
@@ -975,7 +1009,10 @@ public struct TextArea: ContentNode, FormElement {
internal var attributes: OrderedDictionary?
internal var content: [String]
-
+
+ /// Create a text area.
+ ///
+ /// - Parameter content: The area's content.
public init(@ContentBuilder content: () -> [String]) {
self.content = content()
}
@@ -1345,10 +1382,15 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-/// The element represents a comment output.
+/// An element that represents an action button.
+///
+/// Use `Button` to trigger an associated action.
///
-/// ```html
-///
+/// ```swift
+/// Button {
+/// "Lorem ipsum"
+/// }
+/// .type(.button)
/// ```
public struct Button: ContentNode, FormElement {
@@ -1357,7 +1399,10 @@ public struct Button: ContentNode, FormElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a button.
+ ///
+ /// - Parameter content: The button's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -1686,10 +1731,24 @@ extension Button: Localizable {
}
}
-/// The element represents a set of form controls grouped together.
+/// An element that represents a group container.
///
-/// ```html
-///
+/// Use `Fieldset` to group related controls like ``Input``, ``TextArea`` and ``Legend`` together.
+///
+/// ```swift
+/// Form {
+/// Fieldset {
+/// Label {
+/// "Lorem ipsum"
+/// }
+/// .for("lorem")
+/// Input()
+/// .type(.text)
+/// .name("lorem")
+/// .id("lorem")
+/// }
+/// }
+/// .method(.post)
/// ```
public struct Fieldset: ContentNode, FormElement {
@@ -1698,7 +1757,10 @@ public struct Fieldset: ContentNode, FormElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a fieldset.
+ ///
+ /// - Parameter content: The set's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift
index f9e5707a..39b86a44 100644
--- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift
@@ -1,17 +1,15 @@
-/*
- Abstract:
- The file contains the head elements. The html-element 'head' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The element represents the document's title.
+/// An element that represents the document title.
+///
+/// Use `Title` to define a page title.
///
-/// ```html
-///
+/// ```swift
+/// Head {
+/// Title {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct Title: ContentNode, HeadElement {
@@ -21,6 +19,9 @@ public struct Title: ContentNode, HeadElement {
internal var content: [String]
+ /// Create a title.
+ ///
+ /// - Parameter content: The title's content.
public init(@ContentBuilder content: () -> [String]) {
self.content = content()
}
@@ -216,10 +217,16 @@ extension Title: GlobalAttributes, GlobalEventAttributes {
}
}
-/// The element specifies the document base url.#
+/// An element that represents the base url.
+///
+/// Use `Base` to specify the base url for the document.
///
-/// ```html
-///
+/// ```swift
+/// Head {
+/// Base()
+/// .reference("https://...")
+/// .target(.blank)
+/// }
/// ```
public struct Base: EmptyNode, HeadElement {
@@ -227,6 +234,7 @@ public struct Base: EmptyNode, HeadElement {
internal var attributes: OrderedDictionary?
+ /// Create a base.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -427,10 +435,15 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar
}
}
-/// The element provides meta information about the document.
+/// An element that represents a document property.
///
-/// ```html
-///
+/// Use `Meta` to add more context to a document.
+///
+/// ```swift
+/// Head {
+/// Meta()
+/// .charset(.utf8)
+/// }
/// ```
public struct Meta: EmptyNode, HeadElement {
@@ -438,6 +451,7 @@ public struct Meta: EmptyNode, HeadElement {
internal var attributes: OrderedDictionary?
+ /// Create a meta.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -659,10 +673,14 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA
}
}
-/// The element contains style information for the document.
+/// An element that represents a style sheet.
+///
+/// Use `Style` to define and apply style rules.
///
-/// ```html
-///
+/// ```swift
+/// Style {
+/// "p { color: black; }"
+/// }
/// ```
public struct Style: ContentNode, HeadElement {
@@ -672,6 +690,9 @@ public struct Style: ContentNode, HeadElement {
internal var content: [Content]
+ /// Create a style.
+ ///
+ /// - Parameter content: The style's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -879,10 +900,14 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt
}
}
-/// The element represents a comment output.
+/// An element that represents a resource link.
+///
+/// Use `Link` to associate an external resource with the document.
///
-/// ```html
-///
+/// ```swift
+/// Link()
+/// .relationship(.stylesheet)
+/// .reference("https://...")
/// ```
public struct Link: EmptyNode, HeadElement, BodyElement {
@@ -890,6 +915,7 @@ public struct Link: EmptyNode, HeadElement, BodyElement {
internal var attributes: OrderedDictionary?
+ /// Create a link.
public init() {}
internal init(attributes: OrderedDictionary?) {
diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift
index 52c1fe60..d1b4860b 100644
--- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift
@@ -1,17 +1,13 @@
-/*
- Abstract:
- The file contains the html elements. The html-element 'html' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The element contains the information about the document's content.
+/// An element that represents the document head.
///
-/// ```html
-///
+/// ```swift
+/// Head {
+/// Title {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct Head: ContentNode, HtmlElement {
@@ -20,7 +16,10 @@ public struct Head: ContentNode, HtmlElement {
internal var attributes: OrderedDictionary?
internal var content: [HeadElement]
-
+
+ /// Create a head.
+ ///
+ /// - Parameter content: The head's content.
public init(@ContentBuilder content: () -> [HeadElement]) {
self.content = content()
}
@@ -216,10 +215,19 @@ extension Head: GlobalAttributes, GlobalEventAttributes {
}
}
-/// The element contains the document's content.
+/// An element that represents the document body.
///
-/// ```html
-///
+/// ```swift
+/// Html {
+/// Head {
+/// ...
+/// }
+/// Body {
+/// Heading1 {
+/// "Lorem ipsum..."
+/// }
+/// }
+/// }
/// ```
public struct Body: ContentNode, HtmlElement {
@@ -229,6 +237,9 @@ public struct Body: ContentNode, HtmlElement {
internal var content: [BodyElement]
+ /// Create a body.
+ ///
+ /// - Parameter content: The body's content.
public init(@ContentBuilder content: () -> [BodyElement]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift
index 77a2bc99..a9d6f043 100644
--- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift
@@ -1,27 +1,28 @@
-/*
- Abstract:
- The file contains the input elements. The html-element 'input' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The alias for the element OptionGroup.
-///
-/// Optgroup is the official tag and can be used instead of OptionGroup.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``OptionGroup``.
@_documentation(visibility: internal)
public typealias Optgroup = OptionGroup
-/// The element represents a group of options.
+/// An element that represents a group container.
///
-/// ```html
-///
+/// Use `OptionGroup` to group a set of ``Option``.
+///
+/// ```swift
+/// Select {
+/// OptionGroup {
+/// Option {
+/// "Lorem"
+/// }
+/// .value("lorem")
+/// Option {
+/// "Lorem"
+/// }
+/// .value("lorem")
+/// }
+/// }
+/// .name("lorem")
+/// .id("lorem")
/// ```
public struct OptionGroup: ContentNode, InputElement {
@@ -31,6 +32,9 @@ public struct OptionGroup: ContentNode, InputElement {
internal var content: [Content]
+ /// Create a option group.
+ ///
+ /// - Parameter content: The group's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
@@ -319,10 +323,17 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-/// The element represents an option.
+/// An element that represents an select option.
+///
+/// Use `Option` to add an selectable option to a ``Select`` or ``OptionGroup``.
///
-/// ```html
-///
+/// ```swift
+/// Select {
+/// Option {
+/// "Lorem"
+/// }
+/// .value("lorem")
+/// }
/// ```
public struct Option: ContentNode, InputElement {
@@ -332,6 +343,9 @@ public struct Option: ContentNode, InputElement {
internal var content: [String]
+ /// Create a option.
+ ///
+ /// - Parameter content: The option's content.
public init(@ContentBuilder content: () -> [String]) {
self.content = content()
}
@@ -642,10 +656,27 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes,
}
}
-/// The element represents a caption for the rest of the contents of a fieldset.
+/// The element represents a fieldset caption.
///
-/// ```html
-///
+/// Use `Legend` to give the ``Fieldset`` an accessible description.
+///
+/// ```swift
+/// Form {
+/// Fieldset {
+/// Legend {
+/// "Lorem ipsum..."
+/// }
+/// Label {
+/// "Lorem ipsum"
+/// }
+/// .for("lorem")
+/// Input()
+/// .type(.text)
+/// .name("lorem")
+/// .id("lorem")
+/// }
+/// }
+/// .method(.post)
/// ```
public struct Legend: ContentNode, InputElement {
@@ -655,6 +686,9 @@ public struct Legend: ContentNode, InputElement {
internal var content: [Content]
+ /// Create a legend.
+ ///
+ /// - Parameter content: The legend's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
@@ -928,10 +962,19 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-/// The element represents a summary, caption, or legend for the rest of the content.
+/// An element that represents a detail label.
+///
+/// Use `Summary` to give a brief description of the content it controls.
///
-/// ```html
-///
+/// ```swift
+/// Details {
+/// Summary {
+/// "Lorem ipsum"
+/// }
+/// Paragraph {
+/// "Lorem ipsum..."
+/// }
+/// }
/// ```
public struct Summary: ContentNode, InputElement {
@@ -941,6 +984,9 @@ public struct Summary: ContentNode, InputElement {
internal var content: [Content]
+ /// Create a summary.
+ ///
+ /// - Parameter content: The summary's content.
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift
index 01080234..22da8b2c 100644
--- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift
@@ -1,27 +1,22 @@
-/*
- Abstract:
- The file contains the list elements. The html-element 'ol' or 'ul' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The alias for the element ListItem.
-///
-/// Li is the official tag and can be used instead of ListItem.
-///
-/// ```html
-///
-/// ```
+/// The alias for the element ``ListItem``.
@_documentation(visibility: internal)
public typealias Li = ListItem
-/// The element represents a item of a list.
+/// An element that represents a list item.
+///
+/// Use `ListItem` to define an entry within a ``UnorderedList`` or ``OrderedList``.
///
-/// ```html
-///
+/// ```swift
+/// UnorderedList {
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// ListItem {
+/// "Lorem ipsum"
+/// }
+/// }
/// ```
public struct ListItem: ContentNode, ListElement {
@@ -30,7 +25,10 @@ public struct ListItem: ContentNode, ListElement {
internal var attributes: OrderedDictionary?
internal var content: [Content]
-
+
+ /// Create a list item.
+ ///
+ /// - Parameter content: The item's content
public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift
index 92702733..b8fa2390 100644
--- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift
@@ -1,26 +1,21 @@
-/*
- Abstract:
- The file contains the map elements. The html-element 'map' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// A element that defines an image map area.
+/// An element that represents a map area.
///
-/// Use `Area` to define specific clickable regions within an image map.
+/// Use `Area` to define a region within an ``Map``.
///
/// ```swift
/// Image()
/// .source(...png)
-/// .useMap("#...")
+/// .useMap("lorem")
/// Map {
/// Area()
-/// .coordinates("...")
+/// .shape(.circle)
+/// .coordinates(10, 10, 10 ,10)
+/// .alternate("Lorem ipsum...")
+/// .reference("https://...")
/// }
-/// .name("...")
+/// .name("lorem")
/// ```
public struct Area: EmptyNode, MapElement {
@@ -28,7 +23,7 @@ public struct Area: EmptyNode, MapElement {
internal var attributes: OrderedDictionary?
- /// Creates a area
+ /// Creates a area.
public init() {}
@available(*, deprecated, message: "The area element is actually an empty element. Use Area() instead.")
diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift
index d2476638..61531dab 100644
--- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift
@@ -1,17 +1,16 @@
-/*
- Abstract:
- The file contains the media elements. The html-element 'audio' or 'video' only allows these elements to be its descendants.
-
- Note:
- If you about to add something to the file, stick to the official documentation to keep the code consistent.
- */
-
import OrderedCollections
-/// The element allows authors to specify multiple alternative source for other elements.
+/// An element that represents a media source.
///
-/// ```html
-///
+/// Use `Source` to specify multiple alternative sources for media elements like ``Audio`` or ``Video``.
+///
+/// ```swift
+/// Video {
+/// Source()
+/// .source(...mp4)
+/// Source()
+/// .source(...ogg)
+/// }
/// ```
public struct Source: EmptyNode, MediaElement {
@@ -19,6 +18,7 @@ public struct Source: EmptyNode, MediaElement {
internal var attributes: OrderedDictionary?
+ /// Create a source.
public init() {}
internal init(attributes: OrderedDictionary?) {
@@ -243,10 +243,20 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source
}
}
-/// The element allows to specify explicit external timed text tracks for media elements.
+/// An element that represents a text track.
+///
+/// Use `Track` to specify timed text tracks for media elements like ``Audio`` or ``Video``.
///
-/// ```html
-///