Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vapor-community/vapor-elementary

A modern and efficient HTML rendering library - inspired by SwiftUI, built for the web.
https://github.com/vapor-community/vapor-elementary

dsl html swift-on-server vapor web

Last synced: 3 months ago
JSON representation

A modern and efficient HTML rendering library - inspired by SwiftUI, built for the web.

Awesome Lists containing this project

README

        

# Elementary: HTML Templating in Pure Swift

**A modern and efficient HTML rendering library - inspired by SwiftUI, built for the web.**

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvapor-community%2Fvapor-elementary%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/vapor-community/vapor-elementary)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvapor-community%2Fvapor-elementary%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/vapor-community/vapor-elementary)

This packages helps you serve [Elementary](https://swiftpackageindex.com/sliemeobn/elementary) HTML web apps with Vapor.

Simply wrap `HTMLResponse` around your HTML content and return it from your routes.

```swift
import Vapor
import VaporElementary

let app = try await Application.make(.detect())

app.get("index") { _ in
HTMLResponse {
MyIndexPage()
}
}
```

Check out the docs in the [Elementary repo](https://github.com/sliemeobn/elementary) for more information.