Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cooklang/cooklang-swift
Cooklang parser implementation in Swift
https://github.com/cooklang/cooklang-swift
Last synced: 3 months ago
JSON representation
Cooklang parser implementation in Swift
- Host: GitHub
- URL: https://github.com/cooklang/cooklang-swift
- Owner: cooklang
- License: mit
- Created: 2021-03-13T17:30:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T17:02:43.000Z (almost 2 years ago)
- Last Synced: 2024-07-05T13:37:08.296Z (4 months ago)
- Language: Swift
- Homepage: https://cooklang.org
- Size: 298 KB
- Stars: 38
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# cooklang-swift
This project is an implementation of [Cook Language Spec](https://github.com/cooklang/spec) in Swift language.
## Key Features
- Full support of spec
- macOS/Linux compatible## Install
Install via the [**Swift Package Manger**](https://swift.org/package-manager/) by declaring **cooklang-swift** as a dependency in your `Package.swift`:
``` 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:``` swift
let parsedRecipe = try! Recipe.from(text: program)
```#### Config parser
Creating Swift datastructures from the string containing cook config:``` swift
func parseConfig(_ content: String) -> CookConfig {
let parser = ConfigParser(textConfig)
return parser.parse()
}
```## Development
See [Contributing](CONTRIBUTING.md)
### Codespaces- We are using the default Swift Community template from [microsoft/vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/swift)
- build the package: `swift build --enable-test-discovery`
- run the tests: `swift test --enable-test-discovery`