diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-23 10:50:54 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-23 10:50:54 -0800 |
commit | bef813a87bd1a8578ead47c82857ec6f1eb48a8d (patch) | |
tree | 7b7153221743e0b0d28729a8f7d3d43109c6971a /README.md | |
parent | 29959dc55482b04388bc0c8a426650215ac3d5b2 (diff) |
better layout for usage on README and adding detail to cli descrtiption
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 160 |
1 files changed, 87 insertions, 73 deletions
@@ -1,6 +1,15 @@  # Ponzu +Ponzu is a powerful and efficient open-source "Content-as-a-Service" system +framework and CMS. It provides automatic, free, and secure HTTP/2 over TLS (certificates +obtained via Let's Encrypt - https://letsencrypt.org), a useful CMS and +scaffolding to generate content editors, and a fast HTTP API on which to build +modern applications. + +Ponzu is released under the BSD-3-Clause license (see LICENSE). +(c) 2016 Boss Sauce Creative, LLC + ## Installation ``` @@ -9,105 +18,110 @@ $ go get github.com/ponzu-cms/ponzu/... ## Usage -``` +```bash $ ponzu [flags] command <params> +``` -Ponzu is a powerful and efficient open-source "Content-as-a-Service" system -framework. It provides automatic, free, and secure HTTP/2 over TLS (certificates -obtained via Let's Encrypt - https://letsencrypt.org), a useful CMS and -scaffolding to generate content editors, and a fast HTTP API on which to build -modern applications. - -Ponzu is released under the BSD-3-Clause license (see LICENSE). -(c) 2016 Boss Sauce Creative, LLC - -COMMANDS +### COMMANDS -new <directory>: +### new <directory>: - Creates a 'ponzu' directory, or one by the name supplied as a parameter - immediately following the 'new' option in the $GOPATH/src directory. Note: - 'new' depends on the program 'git' and possibly a network connection. If - there is no local repository to clone from at the local machine's $GOPATH, - 'new' will attempt to clone the 'github.com/ponzu-cms/ponzu' package from - over the network. +Creates a 'ponzu' directory, or one by the name supplied as a parameter +immediately following the 'new' option in the $GOPATH/src directory. Note: +'new' depends on the program 'git' and possibly a network connection. If +there is no local repository to clone from at the local machine's $GOPATH, +'new' will attempt to clone the 'github.com/ponzu-cms/ponzu' package from +over the network. - Example: - $ ponzu new myProject - > New ponzu project created at $GOPATH/src/myProject +Example: +```bash +$ ponzu new myProject +> New ponzu project created at $GOPATH/src/myProject +``` - Errors will be reported, but successful commands retrun nothing. +Errors will be reported, but successful commands retrun nothing. +--- +### generate, gen, g <type (,...fields)>: -generate, gen, g <type (,...fields)>: +Generate a content type file with boilerplate code to implement +the editor.Editable interface. Must be given one (1) parameter of +the name of the type for the new content. The fields following a +type determine the field names and types of the content struct to +be generated. These must be in the following format: +fieldName:"T" - Generate a content type file with boilerplate code to implement - the editor.Editable interface. Must be given one (1) parameter of - the name of the type for the new content. The fields following a - type determine the field names and types of the content struct to - be generated. These must be in the following format: - fieldName:"T" +Example: +```bash +$ ponzu gen review title:"string" body:"string" rating:"int" tags:"[]string" +``` - Example: - $ ponzu gen review title:"string" body:"string" rating:"int" tags:"[]string" +The command above will generate a file `content/review.go` with boilerplate +methods, as well as struct definition, and cooresponding field tags like: - The command above will generate a file 'content/review.go' with boilerplate - methods, as well as struct definition, and cooresponding field tags like: +```go +type Review struct { + Title string `json:"title"` + Body string `json:"body"` + Rating int `json:"rating"` + Tags []string `json:"tags"` +} +``` - type Review struct { - Title string `json:"title"` - Body string `json:"body"` - Rating int `json:"rating"` - Tags []string `json:"tags"` - } +The generate command will intelligently parse more sophisticated field names +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 retrun nothing. - The generate command will intelligently parse more sophisticated field names - 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 retrun nothing. +--- +### build +From within your Ponzu project directory, running build will copy and move +the necessary files from your workspace into the vendored directory, and +will build/compile the project to then be run. -build +Example: +```bash +$ ponzu build +``` - From within your Ponzu project directory, running build will copy and move - the necessary files from your workspace into the vendored directory, and - will build/compile the project to then be run. - - Example: - $ ponzu build +Errors will be reported, but successful build commands return nothing. - Errors will be reported, but successful build commands return nothing. +--- +### run [[--port=8080] [--https]] run <service(,service)>: - Starts the 'ponzu' HTTP server for the JSON API, Admin System, or both. - The segments, separated by a comma, describe which services to start, either - 'admin' (Admin System / CMS backend) or 'api' (JSON API), and, optionally, - if the server should utilize TLS encryption - served over HTTPS, which is - automatically managed using Let's Encrypt (https://letsencrypt.org) - - Example: - $ ponzu run - (or) - $ ponzu --port=8080 --https run admin,api - (or) - $ ponzu run admin - (or) - $ ponzu --port=8888 run api - - Defaults to '--port=8080 run admin,api' (running Admin & API on port 8080, without TLS) - - Note: - Admin and API cannot run on separate processes unless you use a copy of the - database, since the first process to open it receives a lock. If you intend - to run the Admin and API on separate processes, you must call them with the - 'ponzu' command independently. +Starts the HTTP server for the JSON API, Admin System, or both. +The segments, separated by a comma, describe which services to start, either +'admin' (Admin System / CMS backend) or 'api' (JSON API), and, optionally, +if the server should utilize TLS encryption - served over HTTPS, which is +automatically managed using Let's Encrypt (https://letsencrypt.org) +Example: +```bash +$ ponzu run +(or) +$ ponzu --port=8080 --https run admin,api +(or) +$ ponzu run admin +(or) +$ ponzu --port=8888 run api ``` +Defaults to `$ ponzu --port=8080 run admin,api` (running Admin & API on port 8080, without TLS) + +*Note:* +Admin and API cannot run on separate processes unless you use a copy of the +database, since the first process to open it receives a lock. If you intend +to run the Admin and API on separate processes, you must call them with the +'ponzu' command independently. + +--- + ## Contributing |