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

Support a configurable template file extension #265

Closed
gettoarun opened this issue Nov 18, 2023 · 1 comment
Closed

Support a configurable template file extension #265

gettoarun opened this issue Nov 18, 2023 · 1 comment

Comments

@gettoarun
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, Eta supports templates with fullname + extension or it assumes an extension ".eta". This works best for most cases as files usually have an extension. But there are several files without extensions like Dockerfile, README etc, which are files that would not have an extension. This will force consumers to use read file, Eta.renderString and save file.

Describe the solution you'd like
Eta has a solid defaults / config mechanism with EtaConfig. A new defaultExtension could bring out a better defaulting for template files.
Providing an override defaultExtension: "" could help solve a no-extension file, providing defaultExtension: "jsp" or "asp" could start get interesting as well.

Describe alternatives you've considered
The only alternative i see with forced defaulting is that a consumer system adopt a

  1. Read template file without extension
  2. use Eta renderString
  3. Save template file without extension

Additional context
N/A

gettoarun added a commit to gettoarun/eta that referenced this issue Nov 18, 2023
Added unit test coverage to the two new possibilities and it works for existing .eta formats as well.
@gettoarun gettoarun changed the title Support a configural template file extension Support a configurable template file extension Nov 18, 2023
gettoarun added a commit to gettoarun/eta-docs that referenced this issue Nov 18, 2023
nebrelbug pushed a commit that referenced this issue Nov 30, 2023
* Fixes for #265 - Enable support for default extensions.

Added unit test coverage to the two new possibilities and it works for existing .eta formats as well.

* Removed .bak file generated from a diff tool
@nebrelbug
Copy link
Collaborator

Closed by #266

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