Skip to content

Commit cadadf1

Browse files
committed
- [*] update README
1 parent 329a799 commit cadadf1

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed

README.e.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,25 @@ To put them all together, check out,
105105

106106
#### > {{cat "cmd/easygen/main.go" | color "go"}}
107107

108+
### Different Versions
109+
110+
The `easygen` has gone through three different versions whose API are a bit different between them.
111+
112+
To always stay at the latest version, `import`
113+
114+
"github.com/go-easygen/easygen"
115+
116+
in your Go code. However, to stay within a certain version, `import` the following package respectively to what you need:
117+
118+
- V3: "[gopkg.in/easygen.v3](https://gopkg.in/easygen.v3)"
119+
- V2: "[gopkg.in/easygen.v2](https://gopkg.in/easygen.v2)"
120+
- V1: "[gopkg.in/easygen.v1](https://gopkg.in/easygen.v1)"
121+
122+
To see the differences between them, check out
123+
124+
- [V3 vs V2](https://github.com/go-easygen/easygen/wiki/V3-vs-V2)
125+
- [V2 vs V1](https://github.com/go-easygen/easygen/wiki/V2-vs-V1)
126+
108127
## Author(s) & Contributor(s)
109128

110129
Tong SUN

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
- [Command line](#command-line)
2121
- [The library ](#the-library-)
2222
- [> cmd/easygen/main.go](#-cmdeasygenmaingo)
23-
- [Author(s) & Contributor(s)](#author(s)-&-contributor(s))
23+
- [Different Versions](#different-versions)
24+
- [Author(s) & Contributor(s)](#author(s)-&-contributor(s))
2425

2526
# easygen - Easy to use universal code/text generator
2627

2728
Command `easygen` is an easy to use universal code/text generator.
2829

29-
It can be used as a text or html generator for arbitrary purposes with arbitrary data and templates.
30+
It can be used as a text or html generator for _arbitrary_ purposes with _arbitrary_ data and templates.
3031

3132
It can be used as a code generator, or anything that is structurally repetitive. Some command line parameter handling code generator are provided as examples, including the Go's built-in `flag` package, and the `viper` & `cobra` package.
3233

@@ -37,6 +38,8 @@ You can even use easygen as a generic Go template testing tool using the `-ts` c
3738

3839
### $ easygen
3940
```sh
41+
easygen version git-master
42+
4043
Usage:
4144
easygen [flags] YamlFileName [YamlFileName...]
4245

@@ -48,12 +51,6 @@ Flags:
4851
extension of template file (default ".tmpl")
4952
-ey extension
5053
extension of yaml file (default ".yaml")
51-
-html
52-
treat the template file as html instead of text
53-
-rf string
54-
replace from, the from string used for the replace function
55-
-rt string
56-
replace to, the to string used for the replace function
5754
-tf name(s)
5855
.tmpl (comma-separated) template file name(s) (default: same as .yaml file)
5956
-ts string
@@ -187,6 +184,8 @@ import (
187184
////////////////////////////////////////////////////////////////////////////
188185
// Global variables definitions
189186

187+
var version = "git-master"
188+
190189
////////////////////////////////////////////////////////////////////////////
191190
// Main
192191

@@ -198,7 +197,6 @@ func main() {
198197
if flag.NArg() < 1 {
199198
Usage()
200199
}
201-
easygen.TFStringsInit() // Done *after* flag parsing!
202200

203201
tmpl0 := easygen.NewTemplate().Customize()
204202
tmpl := tmpl0.Funcs(easygen.FuncDefs()).
@@ -213,6 +211,25 @@ func main() {
213211
}
214212
```
215213

214+
### Different Versions
215+
216+
The `easygen` has gone through three different versions whose API are a bit different between them.
217+
218+
To always stay at the latest version, `import`
219+
220+
"github.com/go-easygen/easygen"
221+
222+
in your Go code. However, to stay within a certain version, `import` the following package respectively to what you need:
223+
224+
- V3: "[gopkg.in/easygen.v3](https://gopkg.in/easygen.v3)"
225+
- V2: "[gopkg.in/easygen.v2](https://gopkg.in/easygen.v2)"
226+
- V1: "[gopkg.in/easygen.v1](https://gopkg.in/easygen.v1)"
227+
228+
To see the differences between them, check out
229+
230+
- [V3 vs V2](https://github.com/go-easygen/easygen/wiki/V3-vs-V2)
231+
- [V2 vs V1](https://github.com/go-easygen/easygen/wiki/V2-vs-V1)
232+
216233
## Author(s) & Contributor(s)
217234

218235
Tong SUN

cmd/easygen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
////////////////////////////////////////////////////////////////////////////
3838
// Global variables definitions
3939

40-
var version = "master"
40+
var version = "git-master"
4141

4242
////////////////////////////////////////////////////////////////////////////
4343
// Main

0 commit comments

Comments
 (0)