Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed GoTemplate to Pongo.

  • Loading branch information...
commit cce3276d1fb8ada93515be2af105d2133e1bd6fe 1 parent 2ab2c39
@flosch authored
View
11 README.md
@@ -1,4 +1,4 @@
-GoTemplate is a template engine which implements a [Django-template](https://docs.djangoproject.com/en/dev/topics/templates/)-like syntax.
+Pongo is a template engine which implements a [Django-template](https://docs.djangoproject.com/en/dev/topics/templates/)-like syntax.
Please have a look at the test (`template_test.go`) for examples.
@@ -20,7 +20,7 @@ Please have a look at the test (`template_test.go`) for examples.
package main
import (
- "github.com/flosch/GoTemplate"
+ "github.com/flosch/Pongo"
"net/http"
)
@@ -30,7 +30,6 @@ Please have a look at the test (`template_test.go`) for examples.
err := tplExample.ExecuteRW(w, nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
- return
}
}
@@ -43,14 +42,14 @@ Please have a look at the test (`template_test.go`) for examples.
See GoPkgDoc for a list of implemented filters/tags and how to use the simple API:
-[http://go.pkgdoc.org/github.com/flosch/GoTemplate](http://go.pkgdoc.org/github.com/flosch/GoTemplate)
+[http://go.pkgdoc.org/github.com/flosch/Pongo](http://go.pkgdoc.org/github.com/flosch/Pongo)
You can simply add your own filters/tags. See the template_test.go for an example implementation.
# Status
-GoTemplate is still in beta and has a very few known bugs (this is why the tests fail).
+Pongo is still in beta and has a very few known bugs (this is why the tests fail).
# License
-GoTemplate is licensed under the MIT-license (see LICENSE file for more).
+Pongo is licensed under the MIT-license (see LICENSE file for more).
View
2  context.go
@@ -1,4 +1,4 @@
-package template
+package pongo
// A Context is used to pass data to the template. You can pass whatever you
// want in interface{}.
View
4 doc.go
@@ -1,4 +1,4 @@
-// GoTemplate implements a Django-syntax-like templating engine.
+// Pongo implements a Django-syntax-like templating engine.
//
// See the tests for examples.
-package template
+package pongo
View
2  expr.go
@@ -1,4 +1,4 @@
-package template
+package pongo
import (
"errors"
View
2  filters.go
@@ -1,4 +1,4 @@
-package template
+package pongo
// TODO: Add context-sensitive filters (so they know their location, e.g. for
// context-sensitive escaping within javascript <-> normal body html.)
View
2  helper.go
@@ -1,4 +1,4 @@
-package template
+package pongo
import (
"strings"
View
2  tags.go
@@ -1,4 +1,4 @@
-package template
+package pongo
import (
"errors"
View
2  template.go
@@ -1,4 +1,4 @@
-package template
+package pongo
/* Examples:
* {% if a.test == b.bla %}
View
12 template_test.go
@@ -1,4 +1,4 @@
-package template
+package pongo
import (
"errors"
@@ -110,10 +110,10 @@ var standard_tests = []test{
// Simple variables
{"{{ foo }}", "", nil, ""},
{"{{ foo.bar }}", "", nil, ""},
- {"{{ name }}", "GoTemplate", Context{"name": "GoTemplate"}, ""},
- {"{{ name.5 }}", "p", Context{"name": "GoTemplate"}, ""},
- {"{{ name.five }}", "p", Context{"name": "GoTemplate", "five": 5}, ""},
- {"{{ name.five.0 }}", "p", Context{"name": "GoTemplate", "five": 5}, ""},
+ {"{{ name }}", "Pongo", Context{"name": "Pongo"}, ""},
+ {"{{ name.3 }}", "g", Context{"name": "Pongo"}, ""},
+ {"{{ name.three }}", "g", Context{"name": "Pongo", "three": 3}, ""},
+ {"{{ name.three.0 }}", "g", Context{"name": "Pongo", "three": 3}, ""},
// Context item access
{"{{ person.Name }}", "Florian", Context{"person": &person}, ""},
@@ -146,7 +146,7 @@ var standard_tests = []test{
{"{{ person.SayHelloTo:\"Cowboy, Mike\",\"Cowboy, Thorsten\" }}", "", Context{"person": person}, ""}, // call w/ args (w/o pointer)
{"{{ person.SayHelloTo:5,\"Cowboy, Thorsten\" }}", "", Context{"person": person}, ""}, // call w/ args (w/o pointer) (wrong arg type)
- // Time samples (no need for a date-filter, because you can simply call time's Format method from GoTemplate)
+ // Time samples (no need for a date-filter, because you can simply call time's Format method from Pongo)
{"{{ mydate.Format:\"02.01.2006 15:04:05\" }}", "18.08.2012 10:49:12", Context{"mydate": time.Date(2012, time.August, 18, 10, 49, 12, 0, time.Now().Location())}, ""},
}
Please sign in to comment.
Something went wrong with that request. Please try again.