summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-02 11:28:58 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-02 11:28:58 -0700
commitb2fa4a895dea4212806c97c434119e73560e25cd (patch)
treeac59f43c7477ea98c4c0d0bf1ae8a37dac9bd88a /README.md
parentfe5367c2d1454e2ff6b330a8e80d4daa853f2c71 (diff)
updating readme with input view specifiers
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files changed, 25 insertions, 4 deletions
diff --git a/README.md b/README.md
index cd4c1bb..c79c6c6 100644
--- a/README.md
+++ b/README.md
@@ -90,10 +90,10 @@ Example:
generator struct fields and built-in types...
| |
v v
-$ ponzu gen content review title:"string" body:"string" rating:"int" tags:"[]string"
- ^
- |
- struct type
+$ ponzu gen content review title:"string" body:"string":richtext rating:"int"
+ ^ ^
+ | |
+ struct type (optional) input view specifier
```
The command above will generate the file `content/review.go` with boilerplate
@@ -113,6 +113,27 @@ such as 'field_name' and convert it to 'FieldName' and vice versa, only where
appropriate as per common Go idioms. Errors will be reported, but successful
generate commands return nothing.
+**Input View Specifiers** _(optional)_
+
+The CLI can optionally parse a third parameter on the fields provided to generate
+the type of HTML view an editor field is presented within. If no third parameter
+is added, a plain text HTML input will be generated. In the example above, the
+argument shown as `body:string:richtext` would show the Richtext input instead
+of a plain text HTML input (as shown in the screenshot). The following input
+view specifiers are implmeneted:
+
+| CLI parameter | Generates |
+|---------------|-----------|
+| checkbox | `editor.Checkbox()` |
+| custom | generates a pre-styled empty div to fill with HTML |
+| file | `editor.File()` |
+| hidden | `editor.Input()` + uses type=hidden |
+| input, text | `editor.Input()` |
+| richtext | `editor.Richtext()` |
+| select | `editor.Select()` |
+| textarea | `editor.Textarea()` |
+| tags | `editor.Tags()` |
+
---
### build