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 jinja2-strcase Jinja extension #1355

Open
marcelmindemann opened this issue Oct 4, 2023 · 1 comment
Open

Add jinja2-strcase Jinja extension #1355

marcelmindemann opened this issue Oct 4, 2023 · 1 comment

Comments

@marcelmindemann
Copy link

Actual Situation

Hi, copier already vendors https://gitlab.com/dreamer-labs/libraries/jinja2-ansible-filters/ to provide additional helpers and filters in templates. I would like to suggest adding https://pypi.org/project/jinja2-strcase/ as well, as bootstrapping a new project often involves rendering the project name in multiple cases in different contexts. For example, many micro services today include both business code and infrastructure-as-code in the same project. A Python project would require snake_case for the project name, whereas the CDK for AWS infrastructure would idiomatically use CamelCase. Makefile targets would idiomatically need kebab-case. Instead of manually crafting these different representations of the project name, jinja2-strcase would bring this to copier out of the box.

Desired Situation

Proposed solution

@yajo
Copy link
Member

yajo commented Oct 4, 2023

Indeed it looks like a nice filter for Copier use case. However, the need for ansible-filters is because of the to_nice_yaml, which is only available there and is very needed for copier answers files, which are a core Copier feature.

We can add it to the list of recommendations, as it really will be useful in many contexts, as you explained.

Does that seem good to you?

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

No branches or pull requests

2 participants