` Defines a variable
16 | /// - `` Defines preformatted text
17 | open class Code: Tag {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/Sources/SwiftHtml/Tags/Col.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Col.swift
3 | // SwiftHtml
4 | //
5 | // Created by Tibor Bodecs on 2021. 07. 23..
6 | //
7 |
8 | /// The `` tag specifies column properties for each column within a `` element.
9 | ///
10 | /// The `` tag is useful for applying styles to entire columns, instead of repeating the styles for each cell, for each row.
11 | open class Col: EmptyTag {
12 |
13 | }
14 |
15 | public extension Col {
16 |
17 | /// Sets the number of columns a `` element should span
18 | func span(_ value: Int) -> Self {
19 | attribute("span", String(value))
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sources/SwiftHtml/Tags/Colgroup.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Colgroup.swift
3 | // SwiftHtml
4 | //
5 | // Created by Tibor Bodecs on 2021. 07. 23..
6 | //
7 |
8 | /// The `` tag specifies a group of one or more columns in a table for formatting.
9 | ///
10 | /// The `` tag is useful for applying styles to entire columns, instead of repeating the styles for each cell, for each row.
11 | ///
12 | /// **Note:** The `` tag must be a child of a `` element, after any `` elements and before any ``, ``, ``, and `` elements.
13 | ///
14 | /// **Tip:** To define different properties to a column within a ``, use the `` tag within the `` tag.
15 | open class Colgroup: Tag {
16 |
17 | }
18 |
19 | public extension Colgroup {
20 |
21 | /// Specifies the number of columns a column group should span
22 | func span(_ value: Int) -> Self {
23 | attribute("span", String(value))
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/SwiftHtml/Tags/Comment.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Comment.swift
3 | // SwiftHtml
4 | //
5 | // Created by Tibor Bodecs on 2021. 07. 19..
6 | //
7 |
8 | /// The comment tag is used to insert comments in the source code.
9 | ///
10 | /// ``
11 | ///
12 | /// Comments are not displayed in the browsers.
13 | /// You can use comments to explain your code, which can help you when you edit the source code at a later date.
14 | /// This is especially useful if you have a lot of code.
15 | open class Comment: Tag {
16 |
17 | open override class func createNode() -> Node {
18 | Node(type: .comment)
19 | }
20 |
21 | public init(_ contents: String) {
22 | super.init()
23 | setContents(contents)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/SwiftHtml/Tags/Data.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data.swift
3 | // SwiftHtml
4 | //
5 | // Created by Tibor Bodecs on 2021. 07. 23..
6 | //
7 |
8 | /// The `` tag is used to add a machine-readable translation of a given content.
9 | ///
10 | /// This element provides both a machine-readable value for data processors, and a human-readable value for rendering in a browser.
11 | ///
12 | /// **Tip:** If the content is time- or date-related, use the `