gotmpl

command module
v0.0.0-...-284e782 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2018 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

中文版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

Documentation

Overview

Package main provides ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址