Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takaishi/patt
CLI tool to create text file from template and manage templates.
https://github.com/takaishi/patt
cli-app golang
Last synced: 21 days ago
JSON representation
CLI tool to create text file from template and manage templates.
- Host: GitHub
- URL: https://github.com/takaishi/patt
- Owner: takaishi
- Created: 2017-01-08T01:46:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-10T03:52:16.000Z (about 6 years ago)
- Last Synced: 2024-10-06T04:23:22.046Z (about 1 month ago)
- Topics: cli-app, golang
- Language: Go
- Homepage: https://github.com/takaishi/patt
- Size: 114 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# patt
## Description
* Create text file from template.
* Manage template files.## Usage
### Add templateTemplate has front-matter thats has 'name' and 'destination'.
```
$ cat /path/to/template.md
+++
{
"name": "test",
"destination": "/path/to/destination/{{.Year}}{{.Month}}{{.Day}}.md"
}
+++
# {{.Year}}-{{.Month}}-{{.Day}}({{.Week}})## Header2
- foo
- bar
``````
$ patt add /path/to/template.md
```### List templates
```
$ patt list
+------+---------------------------------------------+
| NAME | SOURCE |
+------+---------------------------------------------+
| foo | /Users/r_takaishi/.patt.d/templates/foo.md |
| test | /Users/r_takaishi/.patt.d/templates/test.md |
+------+---------------------------------------------+
```### Create file from template
```
$ patt new test
``````
$ cat /path/to/destination/20170108.md
# 2017-01-05(Thu)## Header2
- foo
- bar
```### Delete template
```
$ patt delete foo
```## Install
Use Homebrew:
```
$ brew install takaishi/fomulas/patt
```Use `go get`:
```bash
$ go get -d github.com/takaishi/patt
```## Contribution
1. Fork ([https://github.com/takaishi/patt/fork](https://github.com/takaishi/patt/fork))
1. Create a feature branch
1. Commit your changes
1. Rebase your local changes against the master branch
1. Run test suite with the `go test ./...` command and confirm that it passes
1. Run `gofmt -s`
1. Create a new Pull Request## Author
[takaishi](https://github.com/takaishi)