8000 Add parameter description field to `cookiecutter.json` · Issue #1835 · cookiecutter/cookiecutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add parameter description field to cookiecutter.json #1835
Closed
@thomas-bc

Description

@thomas-bc

This is an enhancement proposition

Rationale

We use cookiecutter to allow users (who may be unaware of what cookiecutter is) to quickly generate files through a custom command-line utility. One caveat is that when the user is asked for input, it gets prompts like the following

project_name [MyProject]:
project_branch_or_tag [devel]:
Select install_venv:
1 - yes
2 - no
Choose from 1, 2 [1]:

While variables can have a rather verbose name, it is not always the case that the name only can be entirely self-explanatory.
It would be nice if cookiecutter.json would allow some more verbose (e.g. raw text) input along with the variables, to be displayed at prompt-time.

Proposition description

Since the parameters are configured with a cookiecutter.json, it seems like it should be doable to add some kind of description field to parameters so that the displayed when cookiecutter launches its prompts. For example, following the above example, we could imagine something like the following (or any other structure):

{
  "project_name": "MyProject",
  "project_branch_or_tag": "devel",
  "install_venv": ["yes", "no"],
  "__internal_use": {
       "parameter_descriptions": {
           "project_name": "Select your project name:",
           "project_branch_or_tag": "Which branch do you want to checkout?",
           "install_venv": "Do you wish to install a Python virtual environment?" 
  }
}

Which would prompt with the following:

Select your project name [MyProject]:
Which branch do you want to checkout? [devel]:
Do you wish to install a Python virtual environment?:
1 - yes
2 - no
Choose from 1, 2 [1]:




I am unaware of the cookiecutter implementation details, so there may be things I have overlooked. This is a mere feedback from a grateful user :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0