fsprojects-archive / zzarchive-generator-fsharp

[ARCHIVED] Yeoman F# generator
Apache License 2.0
62 stars 27 forks source link

Add a way of asking more questions within a template #46

Open rmunn opened 8 years ago

rmunn commented 8 years ago

In addition to #42, I would like to be able to ask the user several questions after they select a template. For example, I'd like to copy Eto's project templates for Visual Studio to make them available in Ionide. Those templates ask the user several questions, like "Do you want to use one project per platform (recommended), or combine all platforms into a single project?" and "Do you want to use XAML, JSON, or F# code for your UI elements?" Then based on the user's choices, the template is customized appropriately.

With the current generator-fsharp setup, I could simulate this by creating several templates with names like EtoMultiProject and EtoSingleProject. But that would bloat the list of available templates to no good purpose, and probably confuse newbies. (I'm confused enough already by having bare names with no description, which is why I opened #45 to suggest adding descriptions that the user can see when selecting templates). I would prefer to be able to take a single template and tweak it according to the user's choices. Perhaps #42 could be adapted to that purpose; if the user's choices could be passed as command-line parameters to the script, or as function parameters to some template-specified piece of Javascript code, that would allow adequate template customization.