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

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/support/docs.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/connect/support/docs.js