iomentum / cargo-scaffold

cargo scaffold lets you scaffold and generate projects described in a simple TOML file
MIT License
57 stars 12 forks source link

Rename `example.handlebars` in template to `example` in generated project #27

Open SimonSapin opened 2 years ago

SimonSapin commented 2 years ago

When editing a .rs file that contains Handlebars templating, my IDE tries to parse it as Rust code and shows many errors all over the file. If instead the file were named .rs.handlebars, the IDE shows Handlebars syntax highlighting and does not try (and fail) at parsing Rust code.

I’d like to do this in the template but have the .handlebars suffix be removed in the generated file names. Do you think this kind of name mapping could be added? Should it be enabled by default or with opt-in configuration in .scaffold.toml?