https://github.com/alice1017/load-template
Create a file from the template with the variables.
https://github.com/alice1017/load-template
template-rendering
Last synced: about 2 months ago
JSON representation
Create a file from the template with the variables.
- Host: GitHub
- URL: https://github.com/alice1017/load-template
- Owner: alice1017
- License: mit
- Created: 2018-03-28T01:25:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-10T02:22:12.000Z (about 7 years ago)
- Last Synced: 2025-02-15T08:25:57.965Z (3 months ago)
- Topics: template-rendering
- Language: Python
- Size: 34.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# load-template
[](http://forthebadge.com)
[](https://travis-ci.org/alice1017/load-template)
[](https://coveralls.io/github/alice1017/load-template)
* [:page_facing_up: Overview](#page_facing_up-overview)
* [:wrench: Usage](#wrench-usage)
* [:inbox_tray: Installation](#inbox_tray-installation)
* [:eyes: Contribution](#eyes-contribution)
* [CHANGELOG](#changelog)## :page_facing_up: Overview
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 :open_file_folder: `~/.templates/`.
If you want to add new default template, please send pull request. :+1:
## :wrench: Usage
### basic
```
$ load-template [template] [file] [variables [variables ...]]
```### positional arguments
* ***template*** - The template name. You can show all templates by `--list`.
* ***file*** - The file name to create.
* ***variables*** - The template variables formatted `key=value`.### optional arguments
* *-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.### template variable
You can set some **variables** to the template as follows:
```html
Hello, {name}
```when use this variable:
```
$ load-template template hello.html name=Alice
```rendered:
```html
Hello, Alice
```## :inbox_tray: Installation
```
$ git clone [email protected]: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.## :eyes: Contribution
1. Forks on [Github](https://github.com/alice1017/load-template)
2. Find a bug? Add new default template? Send a pull request to get it merged and published.## CHANGELOG
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)### [1.0.0] - 2018/4/16
#### Added new feature
* 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 new template
* Added `templates/readme-py` template.
* Added `templates/python-argparser` template.#### Changed
* Changed a template name: `mit_license` to `mit-license`
#### Other
* Use [**travis-ci**](https://travis-ci.org/alice1017/load-template).
* Use [**coverall**](https://coveralls.io/github/alice1017/load-template).### [1.0.0b1] - 2018/3/28
A Beta Version Release.
[1.0.0b1]: https://github.com/alice1017/load-template/compare/a2f5136...1.0.0b1
[1.0.0]: https://github.com/alice1017/load-template/compare/1.0.0b1...1.0.0
[#1]: https://github.com/alice1017/load-template/issues/1
[#2]: https://github.com/alice1017/load-template/issues/2
[#3]: https://github.com/alice1017/load-template/issues/3