diff --git a/scripts/_steps.js b/scripts/_steps.js
index 3b584213c..cdab0cbc7 100644
--- a/scripts/_steps.js
+++ b/scripts/_steps.js
@@ -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.');
}
diff --git a/scripts/export_docs.js b/scripts/export_docs.js
index 495a8ef81..f8dadb8ae 100644
--- a/scripts/export_docs.js
+++ b/scripts/export_docs.js
@@ -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'),
diff --git a/scripts/generate/templates/api_methods.tmpl b/scripts/generate/templates/api_methods.tmpl
index 31059b29f..99b9af20e 100644
--- a/scripts/generate/templates/api_methods.tmpl
+++ b/scripts/generate/templates/api_methods.tmpl
@@ -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.
- <%= paramWithDefault(paramName, param.default) %> <%=
- paramType(param.type) %>
+ dt: dfn: code <%= paramWithDefault(paramName, param.default) %>
+ dd.
+ <%= paramType(param.type) %>
<%= indent(param.description || '', 4) %><%
}); %>
- li the usual
+<% } %>
+p.
+ Default method: <%= action.spec.method || 'GET' %>
+ Includes the usual
-h4 Method: <%= action.spec.method || 'GET' %>
-
-h4 Returns:
-p: a(href="#api-conventions-return") the usual
-
-include _examples/<%= action.name %><%
+include _examples/<%= action.name %>.jade<%
});
%>