Scaffold is a tool for you to setup your project layout. It is based upon a minimal implementation of Django's default template engine.
Scaffold setups up the project according to given templates.
Scaffold is highly customizable. It uses {{ variable }} tag to provide customizable templates, same as Django's template system.
Note: variables can be used in files, file names and even directories.
You have two options to install it:
-
git clone this repo
-
cd scafold
directory -
tar -zcvf templates.tar.gz templates
to create a.tar.gz
file -
Now, you are ready to install it. Due to some permission issue, installing scaffold globally is not recommended. If you are using virtualenv, you can run:
python setup.py install
Otherwise, you should use:
python setup install --user
Similar as above, if you're using virtualenv, use
pip install scaffolding
Otherwise use
pip install scaffolding --user
scaffold list
scaffold provides some default layout, use this command to list them
scaffold show <name>
Given a name listed by list
command, output it's layout. For example:
|-- utils
| -- __init__.py
|-- README.md
|-- main.py
|-- context
|-- .gitignore
scaffold show -t <path>
Similar to above, output a template's layout given the template's path.
scaffold create <name>
Create the project layout based on given template.
scaffold create -t <path>
Similar to above, the template is given by its path.
scaffold locate
Locate scaffold's template directory. You can add you personal templates here.
scaffold remove <name>
Remove a template if you don't want it.
scaffold install -t <path>
Move a template to the templates directory (result of locate command). After this, you can use to access the template.
**Note:**For a full list of documentation, use scaffold -h
You can create your own templates easily. Here is how to do it:
- use
scaffold locate
to locate the template directory. You should have some default templates in the directory. Here, a template should be a directory in the 'template' directory - In each template, there should be a 'context' file, it defines all your variables. Variables can have default values. For example, I will define 2 variables,
app_name
has no default value whileauthor
has:
app_name
author: ME
Note: {{ variable }}
tag can be used in files, file names and directories. Check out the default templates for examples.