added api.md generation [ci skip]
This commit is contained in:
39
scripts/generate/js_api/templates/api_docs.tmpl
Normal file
39
scripts/generate/js_api/templates/api_docs.tmpl
Normal file
@ -0,0 +1,39 @@
|
||||
# API
|
||||
|
||||
## Table Of Contents
|
||||
|
||||
<%
|
||||
|
||||
function esc(str) {
|
||||
return str.replace(/\|/g, '|');
|
||||
}
|
||||
|
||||
var _paramWithDefault = paramWithDefault;
|
||||
paramWithDefault = function (name, _default) {
|
||||
return esc(_paramWithDefault(name, _default));
|
||||
};
|
||||
|
||||
var _paramType = paramType;
|
||||
paramType = function (type) {
|
||||
return esc(_paramType(type));
|
||||
};
|
||||
|
||||
_.each(actions, function (action) {%>
|
||||
- [<%= action.name %>](#<%= action.name.toLowerCase().replace(/[^\w]/g, '') %>)<%
|
||||
})
|
||||
|
||||
_.each(actions, function (action) {
|
||||
%>
|
||||
|
||||
### <%= action.name %>()
|
||||
|
||||
<%= action.docUrl %>
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
<%
|
||||
_.each(action.allParams, function(param, paramName) {
|
||||
%>|`<%= paramWithDefault(paramName, param.default) %>` | <%= paramType(param.type) %> | <%= esc(param.description || '') %>|
|
||||
<% })
|
||||
|
||||
}); %>
|
||||
Reference in New Issue
Block a user