Pass a function in Jinja Template

Hi,

I want to make a function in jinja template but I am not able to do so.

Please guide me on how to make a function, pass arguments and print the result in jinja templating.

Thanks!

As a templating language, Jinja defines macros rather than functions:

https://jinja.palletsprojects.com/en/3.1.x/templates/#macros

You can use assignment to pass argument and capture the result from a function (this function is in a py file),e.g frappe.get_doc and pass it to the template variable.

https://jinja.palletsprojects.com/en/3.1.x/templates/#assignments