Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to list all variables in all templates #130

Closed
jayvdb opened this issue Nov 15, 2018 · 5 comments
Closed

Add option to list all variables in all templates #130

jayvdb opened this issue Nov 15, 2018 · 5 comments
Assignees
Projects
Milestone

Comments

@jayvdb
Copy link
Member

jayvdb commented Nov 15, 2018

It is important to be able to see a list of variables which are available to be set in the yaml, or re-used in new templates.

The new option would load all of the templates, display a list of "template.ext:variable" pairs, and not write any targets. --list-template-variables seems like a good name.

Due to moban supporting many template processors, this will need to be part of the template engine API

For jinja, this is quite easy:

http://jinja.pocoo.org/docs/dev/api/#jinja2.meta.find_undeclared_variables

@jayvdb
Copy link
Member Author

jayvdb commented Dec 17, 2018

Similar upstream jinja2 issue: pallets/jinja#174

SO thread https://stackoverflow.com/questions/26694767/jinja2-variables-in-included-template

And something similar has been built for statik and coala-mobans
thanethomson/statik#105
https://gitlab.com/jayvdb/mobans/commit/3eedcea1ec450599de08b9c3f7cb91739f2acef6

One solution is to add another global __context__ to hold the dictionary of all variables. Then moban can have its own/internal templates like list_template_variables.jj2 which render command line output.

@PrajwalM2212
Copy link
Collaborator

@jayvdb
Copy link
Member Author

jayvdb commented Jan 24, 2019

For 0.4.0, ill do this feature without plugin api changes, which will be done in 0.5.0

@jayvdb jayvdb added this to the 0.4.0 milestone Jan 24, 2019
@chfw chfw added this to back-log in 0.7.x Jan 29, 2019
@chfw chfw moved this from back-log to blocked in 0.7.x Feb 17, 2019
@chfw
Copy link
Member

chfw commented Feb 17, 2019

waiting for @jayvdb 's time.

@chfw
Copy link
Member

chfw commented Sep 10, 2020

Stale issue.

@chfw chfw closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
0.7.x
blocked
Development

No branches or pull requests

3 participants