Overview

mk-Scaffold takes a template provided as a directory structure with template-files. Templates can be located in the filesystem, or a VCS-Server (Git) like GitHub or GitLab.

It reads a settings file, also called the “questions” file, and prompts the user interactively whether or not to change the settings.

It then takes the template-files and the answers to the questions and generates an output directory structure from it.

Changes from cookiecutter

  • Templated material is located in a template folder and no longer a templated folder (eg: { cookiecutter.project_name })

  • Template configuration file is now yaml and no longer json and supports options and validators.

  • Input validation is done during the prompting of questions.

  • To avoid third party hooks, actions such a file removal on conditional is standard now.

Input

This is a directory structure for a simple scaffold project:

scaffold-something/
├── template/                     <--------- Project template
│   └── ...
├── blah.txt                      <--------- Non-templated files/dirs
│                                            go outside
│
└── scaffold.yml                  <--------- Prompts & default values

You must have:

  • A scaffold.yml file.

  • A template/ directory.

Beyond that, you can have whatever files/directories you want.

See https://gitlab.com/jlecomte/scaffold-project-template for a real-world example of this.

Input file

Input file scaffold.yml will be searched for if a directory is given as input to mk-scaffold. An exact filename can also be given as input.

Input file requires at least a questions section which lists questions to be asked to end user.

Additional fields allow type and input validation.

questions:
  - name: "author"
    schema:
      default: "Julien Lecomte"