Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hiroosak/gendoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •