2017-06-25 17:23:20 +02:00
# Go Liquid Template Parser
2017-06-26 16:36:53 +02:00
`goliquid` is a very early-stage Go implementation of the [Shopify Liquid template language ](https://shopify.github.io/liquid ), for use in [Gojekyll ](https://github.com/osteele/gojekyll ).
2017-06-25 17:23:20 +02:00
## Status
2017-06-26 16:16:25 +02:00
[![Build Status ](https://travis-ci.org/osteele/liquid.svg?branch=master )](https://travis-ci.org/osteele/liquid)
[![Go Report Card ](https://goreportcard.com/badge/github.com/osteele/liquid )](https://goreportcard.com/report/github.com/osteele/liquid)
2017-06-25 17:23:20 +02:00
- [ ] Basics
2017-06-26 21:36:05 +02:00
- [x] Literals
- [ ] String Escapes
2017-06-26 04:59:33 +02:00
- [x] Variables
2017-06-25 17:23:20 +02:00
- [ ] Operators
2017-06-26 21:36:05 +02:00
- [x] Arrays
2017-06-25 17:23:20 +02:00
- [ ] Whitespace Control
- [ ] Tags
- [ ] Comment
- [ ] Control Flow
2017-06-26 02:11:29 +02:00
- [x] if/else/elsif
- [x] unless
- [ ] case/when
2017-06-25 17:23:20 +02:00
- [ ] Iteration
- [ ] for
- [ ] limit, offset, range, reversed
- [ ] break, continue
- [ ] loop variables
- [ ] tablerow
- [ ] cycle
- [ ] Raw
- [ ] Variable
2017-06-26 21:36:05 +02:00
- [x] Assign
2017-06-25 17:23:20 +02:00
- [ ] Capture
- [ ] Filters
## Install
`go get -u github.com/osteele/goliquid`
2017-06-25 18:36:28 +02:00
## Contribute
### Setup
2017-06-25 17:23:20 +02:00
```bash
go get golang.org/x/tools/cmd/stringer
2017-06-25 22:21:31 +02:00
go install golang.org/x/tools/cmd/goyacc
2017-06-25 17:23:20 +02:00
```
2017-06-25 18:36:28 +02:00
Install Ragel. On macOS: `brew install ragel` .
### Workflow
2017-06-25 17:23:20 +02:00
```bash
2017-06-26 21:36:05 +02:00
go generate ./...
go test ./...
2017-06-25 17:23:20 +02:00
```
2017-06-25 18:36:28 +02:00
Test just the scanner:
```bash
2017-06-26 21:36:05 +02:00
cd expressions
ragel -Z scanner.rl & & go test
2017-06-25 22:21:31 +02:00
```
## Attribution
Michael Hamrah's [Lexing with Ragel and Parsing with Yacc using Go ](https://medium.com/@mhamrah/lexing-with-ragel-and-parsing-with-yacc-using-go-81e50475f88f ) was essential to understanding `go yacc` .
2017-06-26 14:23:50 +02:00
## License
MIT License