This project is an implementation of Cook Language Spec in Swift language.
- Full support of spec
- macOS/Linux compatible
Install via the Swift Package Manger by declaring cooklang-swift as a dependency in your Package.swift
:
.package(url: "https://github.com/cooklang/cooklang-swift", from: "0.1.0")
Remember to add cooklang-swift to your target as a dependency.
Creating Swift datastructures from the string containing recipe markup:
let parsedRecipe = try! Recipe.from(text: program)
Creating Swift datastructures from the string containing cook config:
func parseConfig(_ content: String) -> CookConfig {
let parser = ConfigParser(textConfig)
return parser.parse()
}
See Contributing
- We are using the default Swift Community template from microsoft/vscode-dev-containers
- build the package:
swift build --enable-test-discovery
- run the tests:
swift test --enable-test-discovery
- build the package: