Add the ability to customise how questions are asked
See original GitHub issueDiscussed in https://github.com/copier-org/copier/discussions/673
<div type='discussions-op-text'>Originally posted by pfmoore May 23, 2022 The prompt currently appears to be a š¤emoji, followed by the help (if specified), then the item name and a format prompt. Iād like to be able to change the prompt as I find it difficult to read (in particular, the format prompt is very distracting, and Iād like to omit it). Is that possible?</div>
Having checked the source code, it seems that this isnāt possible. But the questionary
library looks very flexible, so it would be possible to do this if there was a way to describe the format in the template configuration. Would such a change be welcome? Iād be more than happy to work on a PR for this, but Iām very new to the project (Iām currently trying to migrate my existing cookiecutter templates over to copier) so I donāt know if thatās something that would be considered a reasonable feature for the project.
Iād imagine doing this via settings in the copier.yml
file, so the format would be decided by the template, rather than by the user. Would that make sense?
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:22 (22 by maintainers)
Top GitHub Comments
My main concerns are:
I think Iād prefer something like:
giving
So basically, "{emoji} {help_or_var_name}: "
If you wanted to include the type, maybe add " [{type}]" just before the colon, but only when itās not āstrā, so you would have:
The emoji is OK, but itās a bit of a personal preference. If copier had a āuser settingsā file, Iād suggest letting the user alter the emoji in that, but I donāt think itās something youād want on a command line. So maybe donāt worry about it for now.
Possibly. But as weāve seen, any given format typically works best with a particular style of help, so thereās an argument that it should be tied to the template as well. But as you say, thatās something to worry about another day š
Maybe expose an API that can be used by 3rd parties, and let someone else do that for you? LOL, so many ideas, so little time.
Iāll do a PR in the next couple of days for the prompt change weāve agreed. Iāll replace the > with 2 spaces as per your earlier message.