mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 04:09:00 +01:00
Change namespace
This commit is contained in:
parent
f491f5ebd2
commit
e2740771b6
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -1,6 +1,6 @@
|
|||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
- [ ] I have searched the [issue list](https://github.com/osteele/liquid/issues)
|
- [ ] I have searched the [issue list](https://github.com/danog/liquid/issues)
|
||||||
- [ ] I have tested my example against Shopify Liquid. (This isn't necessary if the actual behavior is a panic, or an error for which `IsTemplateError` returns false.)
|
- [ ] I have tested my example against Shopify Liquid. (This isn't necessary if the actual behavior is a panic, or an error for which `IsTemplateError` returns false.)
|
||||||
|
|
||||||
## Expected Behavior
|
## Expected Behavior
|
||||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ SOURCEDIR=.
|
|||||||
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
||||||
|
|
||||||
LIB = liquid
|
LIB = liquid
|
||||||
PACKAGE = github.com/osteele/liquid
|
PACKAGE = github.com/danog/liquid
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
|
|
||||||
.DEFAULT_GOAL: ci
|
.DEFAULT_GOAL: ci
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/osteele/liquid"
|
"github.com/danog/liquid"
|
||||||
)
|
)
|
||||||
|
|
||||||
// for testing
|
// for testing
|
||||||
|
@ -3,9 +3,9 @@ package liquid
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/osteele/liquid/filters"
|
"github.com/danog/liquid/filters"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/osteele/liquid/tags"
|
"github.com/danog/liquid/tags"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An Engine parses template source into renderable text.
|
// An Engine parses template source into renderable text.
|
||||||
@ -40,7 +40,7 @@ func (e *Engine) RegisterBlock(name string, td Renderer) {
|
|||||||
//
|
//
|
||||||
// Examples:
|
// Examples:
|
||||||
//
|
//
|
||||||
// * https://github.com/osteele/liquid/blob/master/filters/filters.go
|
// * https://github.com/danog/liquid/blob/master/filters/filters.go
|
||||||
//
|
//
|
||||||
// * https://github.com/osteele/gojekyll/blob/master/filters/filters.go
|
// * https://github.com/osteele/gojekyll/blob/master/filters/filters.go
|
||||||
//
|
//
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Example() {
|
func Example() {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert should be replaced by values.Convert.
|
// Convert should be replaced by values.Convert.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package expressions
|
package expressions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeRangeExpr(startFn, endFn func(Context) values.Value) func(Context) values.Value {
|
func makeRangeExpr(startFn, endFn func(Context) values.Value) func(Context) values.Value {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package expressions
|
package expressions
|
||||||
|
|
||||||
import "github.com/osteele/liquid/values"
|
import "github.com/danog/liquid/values"
|
||||||
|
|
||||||
// Context is the expression evaluation context. It maps variables names to values.
|
// Context is the expression evaluation context. It maps variables names to values.
|
||||||
type Context interface {
|
type Context interface {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO Expression and Closure are confusing names.
|
// TODO Expression and Closure are confusing names.
|
||||||
|
@ -3,7 +3,7 @@ package expressions
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An InterpreterError is an error during expression interpretation.
|
// An InterpreterError is an error during expression interpretation.
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ package expressions
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
type parseValue struct {
|
type parseValue struct {
|
||||||
|
@ -8,7 +8,7 @@ import __yyfmt__ "fmt"
|
|||||||
//line expressions.y:2
|
//line expressions.y:2
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
"math"
|
"math"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
func sortFilter(array []interface{}, key interface{}) []interface{} {
|
func sortFilter(array []interface{}, key interface{}) []interface{} {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
"github.com/osteele/tuesday"
|
"github.com/osteele/tuesday"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module github.com/osteele/liquid
|
module github.com/danog/liquid
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Package liquid is a pure Go implementation of Shopify Liquid templates, developed for use in https://github.com/osteele/gojekyll.
|
Package liquid is a pure Go implementation of Shopify Liquid templates, developed for use in https://github.com/osteele/gojekyll.
|
||||||
|
|
||||||
See the project README https://github.com/osteele/liquid for additional information and implementation status.
|
See the project README https://github.com/danog/liquid for additional information and implementation status.
|
||||||
|
|
||||||
|
|
||||||
The liquid package itself is versioned in gopkg.in. Subpackages have no compatibility guarantees. Except where specifically documented, the “public” entities of subpackages are intended only for use by the liquid package and its subpackages.
|
The liquid package itself is versioned in gopkg.in. Subpackages have no compatibility guarantees. Except where specifically documented, the “public” entities of subpackages are intended only for use by the liquid package and its subpackages.
|
||||||
@ -9,8 +9,8 @@ The liquid package itself is versioned in gopkg.in. Subpackages have no compatib
|
|||||||
package liquid
|
package liquid
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/osteele/liquid/tags"
|
"github.com/danog/liquid/tags"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Bindings is a map of variable names to values.
|
// Bindings is a map of variable names to values.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package parser
|
package parser
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ASTNode is a node of an AST.
|
// ASTNode is a node of an AST.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package parser
|
package parser
|
||||||
|
|
||||||
import "github.com/osteele/liquid/expressions"
|
import "github.com/danog/liquid/expressions"
|
||||||
|
|
||||||
// A Config holds configuration information for parsing and rendering.
|
// A Config holds configuration information for parsing and rendering.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Parse parses a source template. It returns an AST root, that can be compiled and evaluated.
|
// Parse parses a source template. It returns an AST root, that can be compiled and evaluated.
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BlockCompiler builds a renderer for the tag instance.
|
// BlockCompiler builds a renderer for the tag instance.
|
||||||
|
@ -3,7 +3,7 @@ package render
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Compile parses a source template. It returns an AST root, that can be evaluated.
|
// Compile parses a source template. It returns an AST root, that can be evaluated.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package render
|
package render
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config holds configuration information for parsing and rendering.
|
// Config holds configuration information for parsing and rendering.
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Context provides the rendering context for a tag renderer.
|
// Context provides the rendering context for a tag renderer.
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package render
|
package render
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An Error is an error during template rendering.
|
// An Error is an error during template rendering.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package render
|
package render
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// nodeContext provides the evaluation context for rendering the AST.
|
// nodeContext provides the evaluation context for rendering the AST.
|
||||||
|
@ -3,8 +3,8 @@ package render
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Node is a node of the render tree.
|
// Node is a node of the render tree.
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Render renders the render tree.
|
// Render renders the render tree.
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ package tags
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
e "github.com/osteele/liquid/expressions"
|
e "github.com/danog/liquid/expressions"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/osteele/liquid/values"
|
"github.com/danog/liquid/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
type caseInterpreter interface {
|
type caseInterpreter interface {
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
)
|
)
|
||||||
|
|
||||||
func includeTag(source string) (func(io.Writer, render.Context) error, error) {
|
func includeTag(source string) (func(io.Writer, render.Context) error, error) {
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An IterationKeyedMap is a map that yields its keys, instead of (key, value) pairs, when iterated.
|
// An IterationKeyedMap is a map that yields its keys, instead of (key, value) pairs, when iterated.
|
||||||
|
@ -10,8 +10,8 @@ import (
|
|||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ package tags
|
|||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/osteele/liquid/expressions"
|
"github.com/danog/liquid/expressions"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddStandardTags defines the standard Liquid tags.
|
// AddStandardTags defines the standard Liquid tags.
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ package liquid
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/osteele/liquid/parser"
|
"github.com/danog/liquid/parser"
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Template is a compiled Liquid template. It knows how to evaluate itself within a variable binding environment, to create a rendered byte slice.
|
// A Template is a compiled Liquid template. It knows how to evaluate itself within a variable binding environment, to create a rendered byte slice.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osteele/liquid/render"
|
"github.com/danog/liquid/render"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user