Debug Jinja variables in templates

Hi,

I would like to know how to debug Jinja variables in html files of erpnext. Is there any way to do so?

Thanks,

I also want to know this because currently I don’t how see what’s available.

There is some minimal documentation Jinja API but it’s not enough. For example for email templates there is doc available but when writing “Terms and Conditions” template there is no doc

Currently seems this is only way:

{{ frappe.form_dict.doc | e }}

{%- if doc %}
  {{ doc | json | e }}
{%- else %}
  {%- set present = frappe.get_all(doctype, filters={'name': name}) | length -%}
  {{ frappe.get_doc(doctype, name) | json | e if present != 0 }}
{%- endif -%}

It will work for most documents to show some stuff but still not everything.
Also for some documents save them first to see more info.