Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lunjon/gokdl

A parser implementation for the KDL document language in Go.
https://github.com/lunjon/gokdl

golang hacktoberfest kdl

Last synced: about 8 hours ago
JSON representation

A parser implementation for the KDL document language in Go.

Awesome Lists containing this project

README

        

# GoKDL

A parser implementation for the [KDL](https://kdl.dev/) document language in Go.

## Example

The following code shows a minimal example of parsing a KDL document:

```go
package main

import (
"log"
"strings"
"github.com/lunjon/gokdl"
)

func main() {
kdl := `
MyNode "string arg" myint=1234 awesome=true {
child-node
}

// A node with arbitrary name (in quotes)
"Other node with much cooler name!" { Okay; }
`

r := strings.NewReader(kdl)
doc, err := gokdl.Parse(r)
if err != nil {
log.Fatal(err)
}

// Do something with doc ...
}
```

## API

Although the module can be used, and the API is still very rough,
I'm grateful for any feedback and suggestion regarding the API!