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 - ///