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

Imporve Wildcard Jinja2 Documentation. #526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tetrokun
Copy link

@Tetrokun Tetrokun commented Jun 16, 2023

It was confusing trying to just get 1 element from a wildcard file, I found this worked for me, and I feel the documentation should be improved to be more clear for folks that aren't looking to generate a ton of prompts by using the provided for loop way of using wildcards

This is just a suggestion on how the documentation could be improved.

Added additional information on how to utilize wildcards.
@adieyal
Copy link
Owner

adieyal commented Jul 8, 2023

Thanks for the PR. I think it's a bug that {{ choice("colours") }} doesn't do this. You can however use this syntax which I think is a little clearer:

{{ random_sample("__colours__") }}

What are your thoughts? I think that choice should be updated to work with wildcards.

@Tetrokun
Copy link
Author

Agreed, I feel like having choice work with wildcards would be the best solution.

At the end of the day I think it matters most that this 'feature' works, and either random-sample or piping it to random() works. But your method is certainly cleaner., and easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants