[Pre-RFC] Cargo Templates

I made a very very rough example of what would be needed for a template system for me: https://github.com/Keats/kickstart with 2 examples of templates in https://github.com/Keats/kickstart/tree/master/examples (see README for running). It’s essentially https://github.com/audreyr/cookiecutter but in Rust and using TOML for the template config.
I didn’t add generating a template from a remote URL yet but that should work the same as for local templates. I don’t think it will load a template from crates.io though. It is a good idea in theory but you need to start adding the versions to it and it is more annoying to develop (just creating the folders/files vs include_bytes/include_str).

In short:

  • language independent because we are just dealing with files
  • ask questions to the user before generating the project and use that in the templates.
  • we can use those variables for filenames/directories as well.
1 Like