Skip to content

Commit e436ee4

Browse files
committed
single function with DSL library argument
1 parent 3405f60 commit e436ee4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Sources/HtmlSwift/Lib.swift

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// https://github.com/atacan
3+
// 04.06.23
4+
5+
public enum SwiftDSL: String, CaseIterable, Identifiable {
6+
public var id: Self { self }
7+
case pointFree = "Point-Free Co."
8+
case binaryBirds = "Binary Birds (Feather)"
9+
}
10+
11+
public func htmlToSwift(_ html: String, for dsl: SwiftDSL, component: HtmlOutputComponent) throws -> String {
12+
switch dsl {
13+
case .binaryBirds:
14+
return try convertToBinaryBirds(html: html, component: component)
15+
case .pointFree:
16+
return try convertToPointFree(html: html, component: component)
17+
}
18+
}

0 commit comments

Comments
 (0)