Skip to content

Instantly share code, notes, and snippets.

@vikranth22446
Last active July 4, 2018 01:12
Show Gist options
  • Save vikranth22446/50b3b2c8cce3083f6321db76dfffb144 to your computer and use it in GitHub Desktop.
Save vikranth22446/50b3b2c8cce3083f6321db76dfffb144 to your computer and use it in GitHub Desktop.
Cookiecutter new context features with minimal changes

Cookiecutter new format

Installation

pip install -e git+https://github.com/vikranth22446/cookiecutter@update-config#egg=cookiecutter

Features

The fork branch extends cookiecutter to include:

  • custom prompt
  • description
  • prompt_user
  • skip if
  • skip to
  • multilist
  • validation
  • welcome messages
  • local extensions

Full list of extra features

Since the new cookiecutter format s currently under indefinte hold due to lack of sponsorship, this is a fork that can be used in projects with the new context features with minimal changes to the current format.

This is compatabile with version 1.6 up till July 3 2018

Fork url

Sample cookiecutter.json

{"project_name":"Sample project","details": {
"default": "1.1.1",
"prompt": "Custom prompt",
"description": "Description of the field. Must be 3 digits",
"prompt_user": true,
"skip_if": "{% if cookiecutter.project_name == 'Sample Project'%}true{%endif%}",
"skip_to": "auth",
"validation": "\d{1,3}(,\d{3})*"
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment