- Based on the HTTP interface gin, automated build markdown interface documentation
-
Based on the ast implementation, through the ast parsing source code structure. Extract the parameter name, type, comment, and other fields and generate them into the md document.
-
You need to add the necessary comments
@request,@response, and exposed interface names before you build the document. Please refer to examples/api.go for details. -
The directory tree path can be specified with
mark_downcommand line argument, andprefixcommand line argument specifies the file prefix or suffix to traverse,domainset the url path. If you do not set these variables, they will use the default values.
cd $GOPATH/src/github.com/lanshipeng/gin-gen-markdown
go install
# check installation by running:
gin-gen-markdown -h
# generate doc
gin-gen-markdown doc --mark_down=. --prefix=api.go --domain=http://127.0.0.1/