From 191df6c8ececcdb5e4e2602788968866039ae705 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 16 Mar 2017 16:15:10 +0100 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 239738a..8b95c60 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A generic **code**/script/data generator based on [Protobuf](https://developers. --- -This is a generator plugin for the Google Protocol Buffers compiler (`protoc`). +This project is a generator plugin for the Google Protocol Buffers compiler (`protoc`). The plugin parses **protobuf** files, generates an **ast**, and walks a local **templates directory** to generate files using the [Golang's `text/template` engine](https://golang.org/pkg/text/template/). @@ -26,7 +26,7 @@ The plugin parses **protobuf** files, generates an **ast**, and walks a local ** `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 file ending with `.tmpl` will be processed and written to the destination folder, following the file hierarchy of the `template_dir`, and remove the `.tmpl` extension. --- @@ -49,6 +49,12 @@ $> protoc --gotemplate_out=debug=true,template_dir=/path/to/template/directory:. --- +##### Hints + +Shipping the templates with your project is very smart and useful when contributing on git-based projects. + +Another workflow consists in having a dedicated repository for generic templates which is then versioned and vendored with multiple projects (npm package, golang vendor package, ...) + See [examples](./examples). ## Funcmap @@ -65,10 +71,6 @@ Non-exhaustive list of new helpers: See the project helpers for the complete list. -## Hacks - - - ## Install * Install the **Go** compiler and tools from https://golang.org/doc/install