cbroglie/mustache

List variable names present in a template

ebogdum opened this issue · 1 comments

As a user I would like to be able to extract the variable names that are present in the template.
One of the main reasons is that it would make it a lot easier to get those variables in a programatic way.
If you have a DB or file or API that provides the variables, and you have 200 or them in total, but only 4 present in a template, it would make it a lot faster and secure to get only the 4 you need.

For example:

This is a variable called {{ var_name }}, please allow a way of listing it.

File (Template) Variables list:
["var_name"]

Never mind, I just looked at the code and found the ExtractTags function.