Comparing version 0.3.2 to 0.3.3
0.3.3 / 2012-10-16 | ||
================== | ||
* fix --api .receiver | ||
0.3.2 / 2012-10-01 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -6,3 +6,3 @@ | ||
comments.forEach(function(comment){ | ||
if (comment.private) return; | ||
if (comment.isPrivate) return; | ||
if (comment.ignore) return; | ||
@@ -14,3 +14,3 @@ var ctx = comment.ctx; | ||
if (!ctx.string.indexOf('module.exports')) return; | ||
buf.push('## ' + ctx.string.replace('.prototype.', '#')); | ||
buf.push('### ' + context(comment)); | ||
buf.push(''); | ||
@@ -22,2 +22,21 @@ buf.push(desc.full.trim().replace(/^/gm, ' ')); | ||
return buf.join('\n'); | ||
}; | ||
}; | ||
function context(comment) { | ||
var ctx = comment.ctx; | ||
var tags = comment.tags; | ||
switch (ctx.type) { | ||
case 'method': | ||
return (ctx.cons || ctx.receiver) + '#' + ctx.name + '(' + params(tags) + ')'; | ||
default: | ||
return ctx.string; | ||
} | ||
} | ||
function params(tags) { | ||
return tags.filter(function(tag){ | ||
return tag.type == 'param'; | ||
}).map(function(param){ | ||
return param.name + ':' + param.types.join('|'); | ||
}).join(', '); | ||
} |
@@ -261,2 +261,3 @@ /*! | ||
, constructor: RegExp.$1 | ||
, cons: RegExp.$1 | ||
, name: RegExp.$2 | ||
@@ -270,2 +271,3 @@ , string: RegExp.$1 + '.prototype.' + RegExp.$2 + '()' | ||
, constructor: RegExp.$1 | ||
, cons: RegExp.$1 | ||
, name: RegExp.$2 | ||
@@ -276,3 +278,3 @@ , value: RegExp.$3 | ||
// method | ||
} else if (/^(\w+)\.(\w+) *= *function/.exec(str)) { | ||
} else if (/^([\w.]+)\.(\w+) *= *function/.exec(str)) { | ||
return { | ||
@@ -279,0 +281,0 @@ type: 'method' |
{ "name": "dox" | ||
, "description": "Markdown / JSdoc documentation generator" | ||
, "version": "0.3.2" | ||
, "version": "0.3.3" | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
@@ -5,0 +5,0 @@ , "repository": { "type": "git", "url": "git://github.com/visionmedia/dox.git" } |
20153
318