cooklang / cooklang-swift

Cooklang parser implementation in Swift
https://cooklang.org
MIT License
38 stars 3 forks source link

cooklang-swift

This project is an implementation of Cook Language Spec in Swift language.

Key Features

Install

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.

Documentation

Using

Creating Swift datastructures from the string containing recipe markup:

let parsedRecipe = try! Recipe.from(text: program)

Config parser

Creating Swift datastructures from the string containing cook config:

func parseConfig(_ content: String) -> CookConfig {
    let parser = ConfigParser(textConfig)
    return parser.parse()
}

Development

See Contributing

Codespaces