diff --git a/docs/formatter.js b/docs/formatter.js new file mode 100644 index 0000000..4170566 --- /dev/null +++ b/docs/formatter.js @@ -0,0 +1,11 @@ +var jade = require('jade'); +var yaml = require('js-yaml'); + +module.exports = function(comments){ + for(var i in comments){ + comments[i].doc = yaml.safeLoad(comments[i].doc); + } + + var render = jade.compileFile('./template.jade'); + console.log(render({comments: comments})); +}; diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..6e45934 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,9 @@ +

DocAST Documentation

parseFile(filename, options)

Parse documentation information from the provided filename argument
+
Params
Returns

parseContents(contents, options)

Parse documentation information from the provided string content
+
+This function is also available under `docast.parse(contents, options)`
+
Params
Returns
diff --git a/docs/template.jade b/docs/template.jade new file mode 100644 index 0000000..fe76283 --- /dev/null +++ b/docs/template.jade @@ -0,0 +1,16 @@ +doctype html +html +body + h1 DocAST Documentation + each comment in comments + h3=comment.name + '(' + comment.params.join(', ') + ')' + pre=comment.doc.comment + h5 Params + ul + each param in comment.doc.params + li=param.name + ' [' + param.type + ']' + pre=param.comment + h5 Returns + ul + li='[' + comment.doc.returns.type + ']' + pre=comment.doc.returns.comment