mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 10:08:58 +01:00
chunks | ||
errors | ||
expressions | ||
filters | ||
generics | ||
tags | ||
.gitignore | ||
.travis.yml | ||
engine.go | ||
LICENSE | ||
liquid_test.go | ||
Makefile | ||
README.md | ||
template.go |
Go Liquid Template Parser
goliquid
is a very early-stage Go implementation of the Shopify Liquid template language, for use in Gojekyll.
Status
- Basics
- Literals
- String Escapes
- Variables
- Operators
- Arrays
- Whitespace Control
- Literals
- Tags
- Comment
- Control Flow
if
/else
/elsif
unless
case
/when
- Iteration
- modifiers
limit
offset
range
reversed
break
,continue
- loop variables
tablerow
cycle
- modifiers
- Raw
- Variable
- Assign
- Capture
- Filters
- some
- all
Install
go get -u github.com/osteele/goliquid
Contribute
Setup
make setup
Install Ragel. On macOS: brew install ragel
.
Workflow
go generate ./...
go test ./...
Test just the scanner:
cd expressions
ragel -Z scanner.rl && go test
References
https://shopify.github.io/liquid
https://help.shopify.com/themes/liquid
https://github.com/Shopify/liquid/wiki/Liquid-for-Designers
Attribution
Kyoung-chan Lee's https://github.com/leekchan/timeutil for formatting dates.
Michael Hamrah's Lexing with Ragel and Parsing with Yacc using Go was essential to understanding go yacc
.
The original Liquid engine, of course, for the design and documentation of the Liquid template language.
(That said, this is a clean-room implementation to make sure it just implements the documented design.)
License
MIT License