Discover Packages
github.com/flosch/pongo2-addons
package
module
Version:
v0.0.0-...-f969446
Opens a new window with list of versions in this module.
Published: May 26, 2021
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 18 modules, 20 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
pongo2-addons
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
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)
(nothing yet)
TODO
Used libraries
I want to thank the authors of these libraries (which are being used in pongo2-addons):
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.