improved the format of the docs a bit and fixed the generator
This commit is contained in:
@ -76,7 +76,9 @@ module.exports = function (argv, steps) {
|
||||
});
|
||||
},
|
||||
runInModule: function (params, done) {
|
||||
|
||||
params = params || {};
|
||||
params.cwd = path.resolve(__dirname, '../');
|
||||
this.run(params, done);
|
||||
},
|
||||
copy: function (params, done) {
|
||||
var from = params.from;
|
||||
@ -125,7 +127,7 @@ module.exports = function (argv, steps) {
|
||||
});
|
||||
|
||||
if (typeof task === 'function') {
|
||||
task.apply(null, args);
|
||||
task.apply(tasks, args);
|
||||
} else {
|
||||
throw new Error(taskName + ' is an invalid task, does not resolve to a function.');
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ var argv = require('optimist')
|
||||
require('./_steps')(argv, [
|
||||
['runInModule', {
|
||||
cmd: 'node',
|
||||
args: [path.join(__dirname, './generate'), '--force']
|
||||
args: ['scripts/generate', '--force']
|
||||
}],
|
||||
['copy', {
|
||||
from: path.join(__dirname, '../docs/_methods.jade'),
|
||||
|
||||
@ -4,7 +4,7 @@ var actionId = action.name.toLowerCase().replace(/[^\w]+/g, '-');
|
||||
|
||||
%>
|
||||
|
||||
h3#<%= actionId %>.fn
|
||||
h2#<%= actionId %>.fn
|
||||
span.name <%= action.name %>
|
||||
span.args (params, [callback])
|
||||
a.perma(href="api.html#<%= actionId %>", title="Permalink")
|
||||
@ -16,21 +16,20 @@ a.esdoc(href="<%= action.docUrl %>", title="Endpoint Docs")
|
||||
return (i > 0 ? ' | ' : '') + line;
|
||||
}).join('\n') %>
|
||||
|
||||
h4 Params:
|
||||
ul.params.api
|
||||
<% if (_.size(action.allParams)) { %>
|
||||
h3 Params:
|
||||
dl.params.api
|
||||
<% _.each(action.allParams, function (param, paramName) { %>
|
||||
li.
|
||||
<code class="name"><%= paramWithDefault(paramName, param.default) %></code> <span class="types"><%=
|
||||
paramType(param.type) %></span>
|
||||
dt: dfn: code <%= paramWithDefault(paramName, param.default) %>
|
||||
dd.
|
||||
<span class="types"><%= paramType(param.type) %></span>
|
||||
<%= indent(param.description || '', 4) %><%
|
||||
}); %>
|
||||
li <a href="#api-conventions-params">the usual</a>
|
||||
<% } %>
|
||||
p.
|
||||
Default method: <%= action.spec.method || 'GET' %><br>
|
||||
Includes <a href="#api-conventions-return">the usual</a>
|
||||
|
||||
h4 Method: <code><%= action.spec.method || 'GET' %></code>
|
||||
|
||||
h4 Returns:
|
||||
p: a(href="#api-conventions-return") the usual
|
||||
|
||||
include _examples/<%= action.name %><%
|
||||
include _examples/<%= action.name %>.jade<%
|
||||
});
|
||||
%>
|
||||
|
||||
Reference in New Issue
Block a user