hiroosak / gendoc

API Documentation Generator (α version)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gendoc

Build Status

Gendoc is generate documentation from JSON Schema

This is inspired by Prmd.

Install

go get github.com/hiroosak/gendoc

Usage

Gendoc provides these commands.

  • init - Create initialized YAML file
  • doc - Generate HTML from json schema
  • valid - Validation JSON Schema format
  • gen - Generate JSON from YAML

Example

$ 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

doc

Generate a HTML document. This command has these flag options.

  • src - directory where the yaml, json file entered
  • meta - overall API metadata
  • overview - preamble for generated API docs(html format)
# Build docs
$ gendoc doc -src ./src -meta meta.json -overview overview.html > docs.html

meta

{
  "title": "API Title",
  "base_url": "http://localhost/",
  "headers": [
    "X-Service-Token: AAA"
  ]
}

YAML to JSON

Convert the yaml files under the src directory to JSON.

# Build json
$ gendoc gen -src ./src -dst ./dst # src/article.yml -> dst/articles.json

License

MIT

About

API Documentation Generator (α version)


Languages

Language:Go 78.4%Language:Smarty 21.6%