Gendoc is generate documentation from JSON Schema
This is inspired by Prmd.
go get github.com/hiroosak/gendoc
Gendoc provides these commands.
init
- Create initialized YAML filedoc
- Generate HTML from json schemavalid
- Validation JSON Schema formatgen
- Generate JSON from YAML
$ gendoc init article > src/article.yml
$ gendoc init comment > src/comment.yml
$ vim src/{article,comment}.yaml
# Build docs
$ gendoc doc -src ./src -meta meta.json > docs.html
Generate a HTML document. This command has these flag options.
src
- directory where the yaml, json file enteredmeta
- overall API metadataoverview
- preamble for generated API docs(html format)
# Build docs
$ gendoc doc -src ./src -meta meta.json -overview overview.html > docs.html
{
"title": "API Title",
"base_url": "http://localhost/",
"headers": [
"X-Service-Token: AAA"
]
}
Convert the yaml files under the src directory to JSON.
# Build json
$ gendoc gen -src ./src -dst ./dst # src/article.yml -> dst/articles.json
MIT