Input an Html code and get the Swift code for the following DSLs
to generate that Html code.
https://github.com/atacan/Dime-a-Dozen
import HtmlSwift
let htmlInput = """
<a href="url">link text</a>
<br>
"""
try convertToPointFree(html: htmlInput)
⤵
.html(
.head(
),
.body(
.a(
attributes: [
.href("url"),
],
"link text"
),
.br
)
)
or
try convertToBinaryBirds(html: htmlInput)
⤵
Html {
Head()
Body {
A("link text")
.href("url")
Br()
}
}
Without a converter, the only way to switch to the DSL world is to look at your html code on one side and type the Swift code for it on the other side.
Inspired by and adapted from HTMLKit
link |
Stars: 2 |
Last commit: 26 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics