Skip to content

Improve style of prompts using rich#1901

Merged
ericof merged 15 commits intocookiecutter:mainfrom
vemonet:rich-prompts
Aug 2, 2023
Merged

Improve style of prompts using rich#1901
ericof merged 15 commits intocookiecutter:mainfrom
vemonet:rich-prompts

Conversation

@vemonet
Copy link
Copy Markdown
Contributor

@vemonet vemonet commented Jul 17, 2023

Hi, this PR adds rich to the cookiecutter dependencies and improve the style of the prompts without changing the prompt workflow

  • Add a counter, e.g. [1/10], at the start of each prompt so the user knows how many steps are left
  • Default values are shown between parenthesis in the cyan color
  • This enables cookiecutter template creators to use simple markup to style their questions, e.g. `What is [bold yellow]your name[/]"
  • The answers accepted for the different types of prompts are the same as before:
    • y/t/true/yes/on or n/f/false/no/off for boolean questions
    • Using integers for multiple choices questions
    • Json prompt supported the same was as before
  • Add a 2 spaces indent at the start of each prompts

You can find screenshots of the changes proposed in the issue #1885

I used rich as it seems the most mature, maintained, and popular package to style CLI apps in python

@ericof ericof added this to the 2.3.0 milestone Jul 27, 2023
@ericof ericof added the enhancement This issue/PR relates to a feature request. label Jul 27, 2023
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that was not supposed to be pushed in this branch! Well spotted, I removed it @ericof

Copy link
Copy Markdown
Member

@ericof ericof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the bug.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This issue/PR relates to a feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants