Skip to content

Commit

Permalink
Minor fix (#73)
Browse files Browse the repository at this point in the history
* Update the readme

* Correct some modifiers of the anchor element
  • Loading branch information
mattesmohr authored Mar 13, 2022
1 parent 4c01e0f commit 65d283d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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]
Expand Down Expand Up @@ -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.
14 changes: 7 additions & 7 deletions Sources/HTMLKit/External/Elements/BodyElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4561,19 +4561,19 @@ 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 {
return mutate(ping: value)
}

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 {
Expand Down Expand Up @@ -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<String>) -> 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)
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/HTMLKit/External/Elements/InputElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 65d283d

Please sign in to comment.