__Problem__ There is no clear criteria right now for which templates should be included in the stack-templates repo. No one person has control over this repo, making it difficult for tutorial authors to rely on it in their documentation. The output of stack templates can be overwhelming.
__Proposed solution__ Introduce namespacing into the template concept. There definitely room to modify this, but as an initial proposal that keeps backwards compatibility, let's consider:
github:username/template can be found on the repo https://github.com/username/stack-templates, on the master branch, in the file template.hsfilesgithub: leader is for future proofing, if someone wants to add support for Gitlab, Bitbucket, or othersgithub: is left off, it is filled in automatically, so that username/template is treated as github:username/templatetemplate, the assumed username is commercialhaskell, falling back to the current behaviorThen, as an example, the Yesod templates could end up being referred to as yesodweb/postgres, etc.
To deal with the overwhelming output from stack templates: what if we have a README.md or similar file in commercialhaskell/stack-templates which is downloaded and displayed to the user explaining a few of the common templates, and then pointing to a Wiki page or similar where people can share more templates.
I love the idea! This would also address the problem of the templates being hardly documented. Wiki is a media rich enough to help steering in the fogs.
FWIW, SBT also uses Github-based namespacing for templates, I’ve never heard complaints (unlike other features) and there seems to be quite some support for it: https://www.scala-sbt.org/1.0/docs/sbt-new-and-Templates.html.
Also FWIW: those templates are entire repos (which makes them a bit easier to navigate than packing all files in a repo, and allows having separate repos in a single organization), and discovery also happens elsewhere.
Having a whole repo dedicated to a template sounds like a reasonable option to me.
I didn't mention it in the initial bit, but I'm not opposed to moving beyond the hsfiles system to something like whole-repo systems. We'd have to figure out appropriate naming to make it all work nicely, and how to do variable replacement, but I don't see anything insurmountable. But I'd rather focus on fixing the biggest concerns people are raising first, especially since it should be a relatively minor amount of code.
I think I can get my hands dirty with this issue. Was just looking around to get some more Haskell in my systems.
Awesome, go for it @SkyWriter!
It seems like some of the discussion lately has been that the templates are all different and it's unclear which to use. Github repos have some metrics that can help:
A template name
github:username/templatecan be found on the repohttps://github.com/username/stack-templates, on the master branch, in the file template.hsfiles
Maybe I'm missing something, but why go for the short syntax of github:username/template instead of just using URLs directly?
I'd even find that more convenient, if I can directly copy them in from my browser or the other way around.
Or is the idea here that you'd actually type these characters down, so we'd like them to be short?
I regularly type in template names, and I believe many others do too. I use
that feature in training as well. Forcing people to copy paste
significantly longer URLs would be a usability regression from my
perspective.
On Sun, Jun 3, 2018 at 9:29 AM Niklas Hambüchen notifications@github.com
wrote:
A template name github:username/template can be found on the repo
https://github.com/username/stack-templates, on the master branch, in the
file template.hsfilesMaybe I'm missing something, but why go for the short syntax of
github:username/template instead of just using URLs directly?I'd even find that more convenient, if I can directly copy them in from my
browser or the other way around.Or is the idea here that you'd actually type these characters down, so
we'd like them to be short?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/commercialhaskell/stack/issues/4039#issuecomment-394170050,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADBB6OuitGGI6FgAMATcvrcMRbiVZ_dks5t5ADngaJpZM4UMist
.
Maybe I'm missing something, but why go for the short syntax of github:username/template instead of just using URLs directly?
Also, full URLs are already supported.
OK, makes sense!
Addressed by #4103
Darn, missed it by just a couple o' days! Anyways, glad it's landed.