Skip to content

Commit

Permalink
Add HTMLParserBuilder, VaporDSL
Browse files Browse the repository at this point in the history
  • Loading branch information
danny1113 committed Jul 14, 2022
1 parent 929630b commit 965d40a
Showing 1 changed file with 48 additions and 5 deletions.
53 changes: 48 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ Feel free to contribute if you make or find something awesome.
* [Dependency Injection](#dependency-injection)
* [GraphQL](#graphql)
* [HTML](#html)
* [HTML Parser](#html-parser)
* [Networking](#networking)
* [NSAttributedString](#nsattributedstring)
* [REST](#rest)
* [Server-Side](#server-side)
* [SwiftUI](#swiftui)
* [Testing](#testing)
* [UIKit](#uikit)
* [Other](#other)
* [Server-Side](#server-side)
* [SwiftUI](#swiftui)
* [Testing](#testing)
* [UIKit](#uikit)
* [Other](#other)

## Guides
A list of helpful guides/tutorials on result builders
Expand Down Expand Up @@ -258,6 +259,29 @@ let page = document {

* ...

## HTML Parser
* [HTMLParserBuilder](https://github.com/danny1113/html-parser-builder) - Build your HTML parser with declarative syntax and strongly-typed result.

```swift
struct Group {
let h1: String
let h2: String
}

let capture = HTML {
Capture("#group h1", transform: \.textContent)
Capture("#group h2", transform: \.textContent)

} transform: { (output: (String, String)) -> Group in
return Group(
h1: output.0,
h2: output.1
)
} // => HTML<Group>
```

* ...

## Networking
* [swift-request](https://github.com/carson-katri/swift-request) - Declarative HTTP networking, designed for SwiftUI

Expand Down Expand Up @@ -356,6 +380,25 @@ Server(errorRenderer: BasicErrorRenderer()).register {
.listen()
```

* [VaporDSL](https://github.com/danny1113/vapor-dsl) - Declarative, structured syntax for Vapor.

```swift
Group("api") {
// GET /api/
Route(use: index)

// GET /api/todos
Route("todos") { req in
return req.view.render("todos")
}

// POST /api/todos
Route("todos", on: .POST, use: todo)
}
```

* ...

## SwiftUI
* [ControlFlowUI](https://github.com/Karumi/ControlFlowUI) - A library that add control flow functionality to SwitUI, using the power of `@functionBuilder` and `ViewBuilder`

Expand Down

0 comments on commit 965d40a

Please sign in to comment.