Add funcmap description in the README

This commit is contained in:
Manfred Touron 2016-12-10 17:23:59 +01:00
parent 19a3db3d08
commit 1146013b1f
No known key found for this signature in database
GPG Key ID: 9CCF47DF1FD978A1

View File

@ -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