The load-template create a file from the template with the variables, and edit the file in your editor.
You can create templates as freely if you save it 📂 ~/.templates/
.
If you want to add new default template, please send pull request. 👍
$ load-template [template] [file] [variables [variables ...]]
- template - The template name. You can show all templates by
--list
. - file - The file name to create.
- variables - The template variables formatted
key=value
.
- -l, --list - Display the all template list.
- -c, --contents - Display contents of the template.
- -s, --sync - Sync the default template to local template. Before using this feature, you have to do
git pull
. - -n, --no-edit - Create a file from template without edit.
- -D, --dev - Run development mode.
You can set some variables to the template as follows:
<h1>Hello, {name}</h1>
when use this variable:
$ load-template template hello.html name=Alice
rendered:
<h1>Hello, Alice</h1>
$ git clone git@github.com:alice1017/load-template.git
$ cd load-template
$ python setup.py build install
You need to clone this repository for installation, Because the
load-template copies the default templates to ~/.templates/
directory.
- Forks on Github
- Find a bug? Add new default template? Send a pull request to get it merged and published.
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog
1.0.0 - 2018/4/16
- Added
--contents
argument to display template contents. Fixed #2 - Added edit feature. Fixed #3
- Added
--sync
argument to sync default template and local template. Fixed #1
- Added
templates/readme-py
template. - Added
templates/python-argparser
template.
- Changed a template name:
mit_license
tomit-license
1.0.0b1 - 2018/3/28
A Beta Version Release.