Official filter and tag addons for pongo2
Go to file
2014-07-28 16:54:04 +02:00
.gitignore slugify-filter and tests added. 2014-07-26 17:28:14 +02:00
.travis.yml Added dependency to travis-script 2014-07-28 14:41:44 +02:00
filters_test.go naturalday-filter added. 2014-07-28 16:54:04 +02:00
filters.go naturalday-filter added. 2014-07-28 16:54:04 +02:00
LICENSE Initial commit 2014-07-20 00:24:32 +02:00
README.md naturalday-filter added. 2014-07-28 16:54:04 +02:00

pongo2-addons

Build Status GitTip

Official filter and tag add-ons for pongo2. Since this package uses 3rd-party-libraries, it's in its own package.

How to install and use

Install via go get -u github.com/flosch/pongo2-addons. All dependencies will be automatically fetched and installed.

Simply add the following import line after importing pongo2:

_ "github.com/flosch/pongo2-addons"

All additional filters/tags will be registered automatically.

Addons

Filters

  • Regulars

    • filesizeformat (human-readable filesize; takes bytes as input)
    • slugify (creates a slug for a given input)
  • Markup

    • markdown (parses markdown text and outputs HTML; hint: use the safe-filter to make the output not being escaped)
  • Humanize

    • intcomma (put decimal marks into the number)
    • ordinal (convert integer to its ordinal as string)
    • naturalday (converts time.Time-object into today/yesterday/tomorrow if possible; otherwise it will use naturaltime)
    • timesince/timeuntil/naturaltime (human-readable time [duration] indicator)

Tags

(nothing yet)

TODO

  • Support i18n/i10n