Sha256: 6b4ef1422a3fe7bce2c9128f5614757a2d238c70398cd2c70c0c5f509dd36a35
Contents?: true
Size: 1.01 KB
Versions: 17
Compression:
Stored size: 1.01 KB
Contents
var fs = require('fs') , jade = require('jade'); var tmpl = fs.readFileSync('support/docs.jade', 'utf8'); var fn = jade.compile(tmpl); var json = ''; process.stdin.setEncoding('utf8'); process.stdin.on('data', function(chunk){ json += chunk; }).on('end', function(){ json = JSON.parse(json); render(json); }).resume(); function title(comment) { if (!comment.ctx) return ''; if (~comment.ctx.string.indexOf('module.exports')) return ''; if (~comment.ctx.string.indexOf('prototype')) { return comment.ctx.string.replace('.prototype.', '#'); } else { return comment.ctx.string; } } function id(comment) { if (!comment.ctx) return ''; return comment.ctx.string .replace('()', ''); } function ignore(comment) { return comment.ignore || (comment.ctx && ~comment.ctx.string.indexOf('__proto__')) || ~comment.description.full.indexOf('Module dependencies'); } function render(obj) { process.stdout.write(fn({ comments: obj , ignore: ignore , title: title , id: id })); }
Version data entries
17 entries across 17 versions & 2 rubygems