Skip to content

tomjamescn/gotmpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

中文版README.md

gotmpl

Template tools stands for GOlang TeMPLate.

Maybe Mustache for Golang is already a good solution for single template, BUT, it is not perfect because it does not support folder name including placeholder, more binding data input format, comment for placeholder and etc.

feature

  • using Mustache sytanx for template file
  • support placeholder in folder name
  • json file, yaml file and input arguments as binding data
  • summary for all placeholder
  • comment support for placeholder
  • git repository as template path, support https:// http:// git:// ssh:// protocals
  • may be more...

install

go get github.com/tomjamescn/gotmpl

usage

#using test_data including in gotmpl src directory
cd $GOPATH/github/tomjamescn/gotmpl
gotmpl -b `pwd`/test_data/test.json -t `pwd`/test_data -o /tmp/gotmpl/output/test

#using input arguments as binding data
gotmpl -t `pwd`/test_data -o /tmp/gotmpl/output/test index=index

#show summary for all placeholder
gotmpl -t `pwd`/test_data -s 

#using repository as template path
#if using private repository, ssh-copy-id must be executed before!
gotmpl -t https://github.com/tomjamescn/gotmpl -s test_data -o /tmp/output index=TEST dir_name=TEST

thanks

About

template tools stands for GOlang TeMPLate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published