create own custom Twig extensions with a function and a pair of filters.