1
0
Fork 0
mirror of https://github.com/Luzifer/mondash.git synced 2024-12-24 13:01:19 +00:00
mondash/vendor/github.com/flosch/pongo2-addons
Knut Ahlers fd7056f82f
Switch to dep for vendoring, update libraries
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-11-22 21:39:52 +01:00
..
.gitignore Moved towards go1.6 vendoring 2016-03-27 18:01:26 +02:00
.travis.yml Switch to dep for vendoring, update libraries 2017-11-22 21:39:52 +01:00
filters.go Switch to dep for vendoring, update libraries 2017-11-22 21:39:52 +01:00
filters_test.go Switch to dep for vendoring, update libraries 2017-11-22 21:39:52 +01:00
helpers.go Moved towards go1.6 vendoring 2016-03-27 18:01:26 +02:00
LICENSE Moved towards go1.6 vendoring 2016-03-27 18:01:26 +02:00
README.md Switch to dep for vendoring, update libraries 2017-11-22 21:39:52 +01:00

pongo2-addons

Build Status Gratipay

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)
    • truncatesentences / truncatesentences_html (returns the first X sentences [like truncatechars/truncatewords]; please provide X as a parameter)
    • random (returns a random element of the input slice)
  • Markup

    • markdown
  • 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

Used libraries

I want to thank the authors of these libraries (which are being used in pongo2-addons):