From 64be6e7a9c8f84c39ae7e8e1ef8b3af47fbb9535 Mon Sep 17 00:00:00 2001 From: Yukang Date: Tue, 2 Sep 2014 14:52:22 +0800 Subject: [PATCH] fix on README --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5bb214b..c387788 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,22 @@ GoRazor is the Go port of the razor view engine originated from [asp.net in 2011 Install: ```sh +go get gopkg.in/fsnotify.v1 go get github.com/sipin/gorazor ``` Usage: `gorazor template_folder output_folder` or -`gorazor template_file output_file` +`gorazor template_file output_file` or + +`gorazor -watch input_dir output_dir` to auto re-generate code when file changes. + +```bash +new/modify -> generate corresponding Go file, make new directory if necessary +remove -> remove corresponding Go file or directory +``` + # Syntax @@ -289,17 +298,6 @@ Here is a simple example of [gorazor templates](https://github.com/sipin/gorazor (setq web-mode-engines-alist '(("razor" . "\\.gohtml\\'"))) ``` -## How to auto re-generate when gohtml file changes? - -We use `https://gopkg.in/fsnotify.v1` to implement watching option. - -Useage: `gorazor -watch input_dir output_dir` to re-generate gohtml file changes, - -```bash -new/modify -> generate corresponding Go file, make new directory if necessary -remove -> remove corresponding Go file or directory -``` - # Credits The very [first version](https://github.com/sipin/gorazor/releases/tag/vash) of GoRazor is essentially a hack of razor's port in javascript: [vash](https://github.com/kirbysayshi/vash), thus requires node's to run.