It's getting late and I'm a bit too fuzzy to respond to everything, but I'll respond to what I can now and the rest later.
That doesn't seem accurate to me. A template's Cargo.toml
is probably going to include dependencies as literal values... maybe set up some features... maybe tune a few other things too.
Here's the actual Cargo.toml
from the template where the justfile's use of {{...}}
led me to discover the problem with the original templating implementation:
[package]
name = {{toml-escape name}}
version = "0.1.0"
authors = [{{toml-escape author}}]
[dependencies]
clap = "2"
[dependencies.error-chain]
version = "0.9"
default-features = false # disable pulling in backtrace
[profile.release]
lto = true
# Uncomment to sacrifice Drop-on-panic cleanup for 20K space saving
#panic = 'abort'
# We need to specify this explicitly so sed can swap the 3 for "z" in
# release.sh when running with --nightly
opt-level = 3
[features]
nightly = []
I doubt that's what you meant by "nothing except for some {{ interpolation }}
keys".
I think this is one of the details where we need more voices.
Given my use cases, I see single-template repos as a common use case because it allows me to comfortably present templates such as the following examples as independent, top-level offerings with each having its own README.md
and GitHub project listing:
- My current "CLI utility boilerplate" template
- A "rust-cpython library boilerplate" template
I also see single-template repos as potentially being a friendlier, more readily understandable on-ramp for users who have never created a template before.
That said, none of that is directly against a design that enables multi-template repos... just in favour of being careful about a design's effects on the single-template case.
My concerns are that:
- I can still see that causing a non-zero amount of unnoticed mangling if, for example, someone includes the text of their
Cargo.toml
in a code block inside something not intended to be templated, such as anINSTRUCTIONS.md
that is meant to be read after generating a new project or any kind of documentation containing code-snippets in a meta-template repo. (As I remember, Jekyll (and, thus, GitHub Pages) only templates files that begin with a front matter block for just this reason.) - Rust generally aims for an "explicit, but not onerous" design, but
interpolate_patterns = ["*"]
feels a bit too much like the un-Rusty aspects of the Ruby on Rails "convention over configuration" philosophy to me. - We're aiming for comfortable defaults. Do you really want to force anyone who's writing a web application or using just for build automation to have to override the default? It doesn't feel like the right balance to strike.