From 1146013b1f57465687460cdc1a50adf9b1f43c0b Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Sat, 10 Dec 2016 17:23:59 +0100 Subject: [PATCH] Add funcmap description in the README --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c103b5e..b082b9e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The plugin can generate files based on a template directory using the [Golang's `protoc-gen-gotemplate` requires a **template_dir** directory *(by default `./templates`)*. -Every files ending with `.tmpl` will be processed and written in the destination folder, following the file hierarchy of the `template_dir`, and removing the `.tmpl` extension. +Every files ending with `.tmpl` will be processed and written in the destination folder, following the file hierarchy of the `template_dir`, and removing the `.tmpl` extension. --- @@ -38,6 +38,28 @@ $> protoc --gotemplate_out=debug=true,template_dir=/path/to/template/directory:. See [examples](./examples). +## Funcmap + +This project uses [moul/funcmap](https://github.com/moul/funcmap) library to extend the builtin [text/template](https://golang.org/pkg/text/template) helpers. + +Non-exhaustive list of new helpers: + +* `json` +* `prettyjson` +* `indent` +* `split` +* `join` +* `title` +* `unexport` +* `add` +* `trimspace` +* `lower` +* `upper` +* `rev` +* `int` + +See the project for the complete list. + ## Install * Install the **Go** compiler and tools from https://golang.org/doc/install