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

Allow random extensions #17

Open
chevdor opened this issue Sep 29, 2022 · 2 comments
Open

Allow random extensions #17

chevdor opened this issue Sep 29, 2022 · 2 comments

Comments

@chevdor
Copy link
Owner

chevdor commented Sep 29, 2022

We may want to pass a custom extension such as .foobar.
In that case, we could pass an extra flag to provide the format (such as --yaml) or be smart and guess.

@alerque
Copy link
Contributor

alerque commented Feb 16, 2023

This would also be useful for being able handle process substitution without so much song and dance to get extensions sorted:

TMPSUFFIX=.yml
tera -t template <(command_that_generates_context)
unset TMPSUFFIX

Could be:

tera -t template --yaml <(command_that_generates_context)

Personally I would suggest not trying to be smart and guess the type if it isn't noted as an extension. YAML is a disaster to detect because it's technically a superset of JSON, so most JSON is valid YAML and YAML can be made to look very much like JSON but actually work the same way a JSON parser would handle it.

@chevdor
Copy link
Owner Author

chevdor commented Feb 17, 2023

I agree, I am only using the detection based on the extension so spare the user yet another flag but the current rules are rather tight.

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

No branches or pull requests

2 participants