question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Add the ability to customise how questions are asked

See original GitHub issue

Discussed 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:closed
  • Created a year ago
  • Reactions:4
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

2reactions
pfmoorecommented, May 23, 2022

My main concerns are:

  1. I donā€™t find the ā€œFormat: {type}ā€ section of the prompt useful, and the fact that it isnā€™t separated from the value by punctuation is very distracting.
  2. The way the emoji is on the help line if thereā€™s help, but on the variable name line if thereā€™s a variable, is inconsistent and makes it hard for me to review what I entered.
  3. Itā€™s not at all obvious (to me, at least) how to word the help - as a question, or a description.

I think Iā€™d prefer something like:

project_name:
    type: str
    help: Enter your project name
repeat:
    type: int

giving

šŸŽ¤ Enter your project name: my_project šŸŽ¤ repeat: 12

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:

šŸŽ¤ Enter your project name: my_project šŸŽ¤ repeat [int]: 12

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.

1reaction
pfmoorecommented, Jun 1, 2022

FWIW in case we wanted to have this configurable, I think it should be configurable per user, not per template.

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 šŸ™‚

Also some other experience I had in mind was a fullscreen TUI with backwards and forward buttons to let you edit previous answers.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Ask Great Questions - Harvard Business Review
Asking questions is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation...
Read more >
Custom Questions - Review Management - G2 Documentation
Custom questions offer you the opportunity to ask questions about your products that are not included in the standard G2 review form.
Read more >
Create Q&A featured questions for Power BI dashboards
On the dashboard, select the Ask a question about your data Q&A question box. Ā· To create a featured question, in the top-right...
Read more >
How to use Q&A in Power BI to ASK natural ... - YouTube
... how to use one of the AI-based features in Power BI called Q&A, which gives you the ability to ask free-form questions...
Read more >
Show questions based on answers - Google Docs Editors Help
You can set up a survey so that people only see certain sections based on their answers. Open a form in Google Forms....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found