2014-07-20 00:42:24 +02:00
|
|
|
# pongo2-addons
|
2014-07-20 00:24:32 +02:00
|
|
|
|
2014-07-26 17:42:22 +02:00
|
|
|
[![Build Status](https://travis-ci.org/flosch/pongo2-addons.svg?branch=master)](https://travis-ci.org/flosch/pongo2-addons)
|
|
|
|
[![GitTip](http://img.shields.io/badge/gittip-support%20pongo-brightgreen.svg)](https://www.gittip.com/flosch/)
|
|
|
|
|
2014-07-28 16:38:27 +02:00
|
|
|
Official filter and tag add-ons for [pongo2](https://github.com/flosch/pongo2). Since this package uses
|
|
|
|
3rd-party-libraries, it's in its own package.
|
2014-07-20 00:42:24 +02:00
|
|
|
|
2014-07-28 16:38:27 +02:00
|
|
|
## How to install and use
|
2014-07-20 00:50:56 +02:00
|
|
|
|
2014-07-28 16:38:27 +02:00
|
|
|
Install via `go get -u github.com/flosch/pongo2-addons`. All dependencies will be automatically fetched and installed.
|
2014-07-20 00:44:13 +02:00
|
|
|
|
|
|
|
Simply add the following import line **after** importing pongo2:
|
|
|
|
|
|
|
|
_ "github.com/flosch/pongo2-addons"
|
|
|
|
|
2014-07-20 00:50:56 +02:00
|
|
|
All additional filters/tags will be registered automatically.
|
2014-07-20 00:44:13 +02:00
|
|
|
|
2014-07-28 16:38:27 +02:00
|
|
|
## Addons
|
|
|
|
|
|
|
|
### Filters
|
2014-07-20 00:42:24 +02:00
|
|
|
|
2014-07-28 16:29:41 +02:00
|
|
|
- Regulars
|
|
|
|
- **[filesizeformat](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#filesizeformat)** (human-readable filesize; takes bytes as input)
|
2014-07-28 16:38:27 +02:00
|
|
|
- **[slugify](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#slugify)** (creates a slug for a given input)
|
2014-07-28 16:29:41 +02:00
|
|
|
|
|
|
|
- Markup
|
|
|
|
- **markdown** (parses markdown text and outputs HTML; **hint**: use the **safe**-filter to make the output not being escaped)
|
|
|
|
|
|
|
|
- Humanize
|
|
|
|
- **[intcomma](https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#intcomma)** (put decimal marks into the number)
|
|
|
|
- **[ordinal](https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#ordinal)** (convert integer to its ordinal as string)
|
2014-07-28 16:38:27 +02:00
|
|
|
- **[timesince](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#timesince)/[timeuntil](https://docs.djangoproject.com/en/1.6/ref/templates/builtins/#timeuntil)/[naturaltime](https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#naturaltime)** (human-readable time [duration] indicator)
|
2014-07-20 00:42:24 +02:00
|
|
|
|
2014-07-28 16:38:27 +02:00
|
|
|
### Tags
|
2014-07-20 00:42:24 +02:00
|
|
|
|
2014-07-20 00:44:13 +02:00
|
|
|
(nothing yet)
|
2014-07-28 16:38:27 +02:00
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
- Support i18n/i10n
|