README.md (2646B)
1 2 DATI 3 ---- 4 5 **data and template interface** 6 7 dati provides a unified interface for parsing data and templates. 8 Ideally it will support all data and template languages, if it doesn't 9 support one you want submit a PR or contact the developer. 10 11 It can be used as a *Golang library* or an *executable tool*, although 12 it was built as a library first but works well in both forms. 13 14 **dati library** 15 16 The library is incredibly useful if you want to easily parse data and 17 template languages without learning different interface / data 18 structures for every library used for each supported language. 19 20 For documentation on the dati library: 21 [pkg.go.dev/notabug.org/gearsix/dati](https://pkg.go.dev/notabug.org/gearsix/dati#section-documentation) 22 or 23 `go doc -all` in the directory of the *dati* repo 24 25 **dati binary** 26 27 The binary is intended to showcase what the library is useful for and 28 be example of how to use it in your own software. 29 It works perfectly well as a data-template executioner too though. 30 It can parse data files and execute the parsed structure against 31 templates with ease. 32 33 View [cmd/README.md](./cmd/README.md) to see documentation on using the dati binary. 34 35 View [cmd/dati.go](./cmd/dati.go) to view the source of the binary and see how the 36 dati library can be used. 37 38 39 supported formats / languages 40 ----------------------------- 41 42 **supported data languages** 43 44 Below is a list of the supported languages for data-serialisation. 45 46 - JSON (*.json*) see [https://json.org/](https://json.org/) 47 - YAML (*.yaml*) see [yamllint.com/](https://yamllint.com/) 48 - TOML (*.toml*) see [toml.io/](https://toml.io/) 49 50 **supported template language** 51 52 These are the currently supported templating languages. 53 54 - mustache (*.mu*, *.mustache*) see [mustache.github.io/](https://mustache.github.io/) 55 - golang text/template (*.tmpl*, *.gotmpl*) see [golang.org/pkg/text/template/](https://golang.org/pkg/text/template/) 56 - golang html/template (*.hmpl*, *.gohmpl*) see [golang.org/pkg/html/template](/https://golang.org/pkg/html/template/) 57 - note that this and *text/template* are almost interchangable, with the 58 exception that *html/template* will produce "HTML output safe against code 59 injection". 60 <!-- - statix (*.stx* *.statix*) see https://gist.github.com/plugnburn/c2f7cc3807e8934b179e --> 61 62 63 acknowledgments 64 --------------- 65 66 All of these libraries do the hard work, dati just combines them 67 together - so thanks to the authors. Also here for reference. 68 69 - The Go standard library is used for parsing JSON, .tmpl/.gotmpl, .hmpl/.gohmpl 70 - github.com/pelletier/go-toml 71 - gopkg.in/yaml.v3 72 - github.com/cbroglie/mustache 73 74 75 AUTHORS 76 ------- 77 78 - gearsix 79