1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-27 06:34:45 +01:00
Go to file
2017-06-28 13:47:49 -04:00
chunks Filters support multiple argument, including expressions 2017-06-28 11:24:24 -04:00
errors Lint 2017-06-27 13:36:38 -04:00
expressions Filters support multiple argument, including expressions 2017-06-28 11:24:24 -04:00
filters Implement a big chunk of filters 2017-06-28 13:28:55 -04:00
generics Implement a big chunk of filters 2017-06-28 13:28:55 -04:00
tags Implement capture tag 2017-06-28 13:47:49 -04:00
.gitignore Makefile default target is ci 2017-06-27 18:10:12 -04:00
.travis.yml Add a Travis file 2017-06-26 10:16:02 -04:00
engine.go README links to godoc 2017-06-28 09:45:20 -04:00
LICENSE Create LICENSE 2017-06-26 15:36:29 -04:00
liquid_test.go Move tags to own package 2017-06-27 11:39:32 -04:00
Makefile Makefile default target is ci 2017-06-27 18:10:12 -04:00
README.md Implement capture tag 2017-06-28 13:47:49 -04:00
template.go Add public DefineTag 2017-06-27 07:43:42 -04:00

Go Liquid Template Parser

GoDoc

goliquid is a pure Go implementation of Shopify Liquid templates, for use in gojekyll.

Status

Build Status Go Report Card

  • Basics
    • Literals
      • String Escapes
    • Variables
    • Operators (partial)
    • Arrays
    • Whitespace Control
  • Tags
    • Comment
    • Control Flow
      • if/else/elsif
      • unless
      • case/when
    • Iteration
      • modifiers
        • limit
        • offset
        • range
        • reversed
      • break, continue
      • loop variables
      • tablerow
      • cycle
    • Raw
    • Variables
      • Assign
      • Capture
  • Filters (partial)

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.)

Other Implementations

Go:

https://github.com/Shopify/liquid/wiki/Ports-of-Liquid-to-other-environments lists ports to other languages.

License

MIT License