diff --git a/README.md b/README.md index 010428e4..21306df0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Add the packages as dependecies and targets to your package file. dependencies: [ ... ///1. Add the packages - .package(name: "HTMLKit", url: "https://github.com/vapor-community/HTMLKit.git", from: "2.4.0"), + .package(name: "HTMLKit", url: "https://github.com/vapor-community/HTMLKit.git", from: "2.4.5"), .package(name: "HTMLKitVaporProvider", url: "https://github.com/vapor-community/htmlkit-vapor-provider.git", from: "1.2.1") ], targets: [ @@ -31,11 +31,11 @@ targets: [ ... ``` -Read the [installation instructions](https://github.com/vapor-community/HTMLKit/blob/main/Instructions/Installation.md) for more information. +Read the [installation instructions](/Instructions/Installation.md) for more information. ### Definition -Create a new file in your project. Add the import at the top of your file and declare a new structure. Extend your structure by adding a [layout definition](https://github.com/vapor-community/HTMLKit/blob/main/Instructions/Essential/Layouts.md) to adopt the required properties and methods. Add your content to the `body` property. +Create a new file in your project. Add the import at the top of your file and declare a new structure. Extend your structure by adding a [layout definition](/Instructions/Essential/Layouts.md) to adopt the required properties and methods. Add your content to the `body` property. ```swift /// [SimplePage.swift] @@ -87,12 +87,27 @@ final class SimpleController { ### Localization +HTMLKit offers localization by the help of the [Lingo framework](https://github.com/miroslavkovac/Lingo.git). See the [instructions](/Instructions/Features/Localization.md) for more information. + ### Conversion +You dont have to rewrite your whole codebase to use HTMLKit. HTMLKit offers a converter to translate HTML into HTMLKit. See the [instructions](/Instructions/Features/Conversion.md) for more information. + ### Validation +HTMLKit is build with the intention to lead you writing valid code. So you don't need to think about it in particular. + ## Resources ### Instructions -See the [instructions](https://github.com/vapor-community/HTMLKit/blob/main/Instructions/Overview.md) to learn more about the library and the features. +See the [instructions](/Instructions/Overview.md) to learn more about the package and the features. + +### Components + +See the [package](https://github.com/vapor-community/HTMLKit-Components) to extend your experience with HTMLKit. The package is still work in progress, but +it will be available soon. + +### Live Example + +See the [package](https://github.com/mattesmohr/Website) of our contributor, how he uses HTMLKit in his website. diff --git a/Sources/HTMLKit/External/Elements/BodyElements.swift b/Sources/HTMLKit/External/Elements/BodyElements.swift index 0d8696bd..e1187783 100644 --- a/Sources/HTMLKit/External/Elements/BodyElements.swift +++ b/Sources/HTMLKit/External/Elements/BodyElements.swift @@ -4561,7 +4561,7 @@ extension Anchor: GlobalAttributes, DownloadAttribute, ReferenceAttribute, Refer } public func media(_ value: String) -> Anchor { - return mutate(media: value) + return mutate(media: value) } public func ping(_ value: String) -> Anchor { @@ -4569,11 +4569,11 @@ extension Anchor: GlobalAttributes, DownloadAttribute, ReferenceAttribute, Refer } public func referrerPolicy(_ type: Policy) -> Anchor { - return mutate(type: type.rawValue) + return mutate(referrerpolicy: type.rawValue) } public func relationship(_ type: Relation) -> Anchor { - return mutate(type: type.rawValue) + return mutate(rel: type.rawValue) } public func target(_ type: Target) -> Anchor { @@ -13879,15 +13879,15 @@ extension Template: GlobalAttributes { public func id(_ value: String) -> Template { return mutate(id: value) } - - public func language(_ type: Language) -> Template { - return mutate(lang: type.rawValue) - } public func id(_ value: TemplateValue) -> Template { return mutate(id: value.rawValue) } + public func language(_ type: Language) -> Template { + return mutate(lang: type.rawValue) + } + public func nonce(_ value: String) -> Template { return mutate(nonce: value) } diff --git a/Sources/HTMLKit/External/Elements/InputElements.swift b/Sources/HTMLKit/External/Elements/InputElements.swift index 34d0e5fe..179f6275 100644 --- a/Sources/HTMLKit/External/Elements/InputElements.swift +++ b/Sources/HTMLKit/External/Elements/InputElements.swift @@ -362,13 +362,13 @@ extension Option: GlobalAttributes, DisabledAttribute, LabelAttribute, ValueAttr return mutate(value: value.rawValue) } - public func custom(key: String, value: Any) -> Option { - return mutate(key: key, value: value) - } - public func selected() -> Option { return mutate(selected: "selected") } + + public func custom(key: String, value: Any) -> Option { + return mutate(key: key, value: value) + } } extension Option: AnyContent {