get used variables in a template doc