doxy/node/generators/yuidoc/generator.js
function generateDocs(specjs) {
  var docs = GENERATE_MODULE(specjs.MODULE, '');
  GENERATE_TYPE = (function(enums) { 
    return function(type) {
      return (_.contains(enums, type) ? ('Enum ' + type) : type);  
    }
  })(_.keys(specjs.ENUMS_BY_GROUP));
  docs = _.reduce(specjs.METHODS, function(memo, methodSpec, methodName) {
    return memo += GENERATE_METHOD(methodName, methodSpec);
  }, docs);
  docs = _.reduce(specjs.ENUMS, function(memo, enumSpec, enumName) {
    return memo += GENERATE_ENUM(enumName, enumSpec);
  }, docs);
  if (_.isEmpty(specjs.CLASSGROUPS)) {
      docs += GENERATE_CLASSES(specjs.CLASSES);
  } else {
    docs += GENERATE_MODULE('common', '');
    var grouped = _.flatten(_.pluck(_.values(specjs.CLASSGROUPS), 'classes'));
    var ungrouped = _.difference(_.keys(specjs.CLASSES), grouped);
    docs += GENERATE_CLASSES(_.pick(specjs.CLASSES, ungrouped), 'common'); 
    _.each(specjs.CLASSGROUPS, function(groupSpec, groupName) {
      docs += GENERATE_CLASSES(_.pick(specjs.CLASSES, groupSpec.classes), groupName);
    });
    // TODO: figure out why yuidoc won't associate the class with the right module if module definitions are interspersed
    _.each(specjs.CLASSGROUPS, function(groupSpec, groupName) {
        docs += GENERATE_MODULE(groupName, groupSpec.description);
    });
  }
  return docs;
}
function generateDocs(specjs) {
  var docs = GENERATE_MODULE(specjs.MODULE, '');
  GENERATE_TYPE = (function(enums) { 
    return function(type) {
      return (_.contains(enums, type) ? ('Enum ' + type) : type);  
    }
  })(_.keys(specjs.ENUMS_BY_GROUP));
  docs = _.reduce(specjs.METHODS, function(memo, methodSpec, methodName) {
    return memo += GENERATE_METHOD(methodName, methodSpec);
  }, docs);
  docs = _.reduce(specjs.ENUMS, function(memo, enumSpec, enumName) {
    return memo += GENERATE_ENUM(enumName, enumSpec);
  }, docs);
  if (_.isEmpty(specjs.CLASSGROUPS)) {
      docs += GENERATE_CLASSES(specjs.CLASSES);
  } else {
    docs += GENERATE_MODULE('common', '');
    var grouped = _.flatten(_.pluck(_.values(specjs.CLASSGROUPS), 'classes'));
    var ungrouped = _.difference(_.keys(specjs.CLASSES), grouped);
    docs += GENERATE_CLASSES(_.pick(specjs.CLASSES, ungrouped), 'common'); 
    _.each(specjs.CLASSGROUPS, function(groupSpec, groupName) {
      docs += GENERATE_CLASSES(_.pick(specjs.CLASSES, groupSpec.classes), groupName);
    });
    // TODO: figure out why yuidoc won't associate the class with the right module if module definitions are interspersed
    _.each(specjs.CLASSGROUPS, function(groupSpec, groupName) {
        docs += GENERATE_MODULE(groupName, groupSpec.description);
    });
  }
  return docs;
}
function generateDocs ( specjs ) { var docs = GENERATE_MODULE ( specjs . MODULE , '' ) ; GENERATE_TYPE = ( function ( enums ) { return function ( type ) { return ( _ . contains ( enums , type ) ? ( 'Enum ' + type ) : type ) ; } } ) ( _ . keys ( specjs . ENUMS_BY_GROUP ) ) ; docs = _ . reduce ( specjs . METHODS , function ( memo , methodSpec , methodName ) { return memo += GENERATE_METHOD ( methodName , methodSpec ) ; } , docs ) ; docs = _ . reduce ( specjs . ENUMS , function ( memo , enumSpec , enumName ) { return memo += GENERATE_ENUM ( enumName , enumSpec ) ; } , docs ) ; if ( _ . isEmpty ( specjs . CLASSGROUPS ) ) { docs += GENERATE_CLASSES ( specjs . CLASSES ) ; } else { docs += GENERATE_MODULE ( 'common' , '' ) ; var grouped = _ . flatten ( _ . pluck ( _ . values ( specjs . CLASSGROUPS ) , 'classes' ) ) ; var ungrouped = _ . difference ( _ . keys ( specjs . CLASSES ) , grouped ) ; docs += GENERATE_CLASSES ( _ . pick ( specjs . CLASSES , ungrouped ) , 'common' ) ; _ . each ( specjs . CLASSGROUPS , function ( groupSpec , groupName ) { docs += GENERATE_CLASSES ( _ . pick ( specjs . CLASSES , groupSpec . classes ) , groupName ) ; } ) ; // TODO: figure out why yuidoc won't associate the class with the right module if module definitions are interspersed _ . each ( specjs . CLASSGROUPS , function ( groupSpec , groupName ) { docs += GENERATE_MODULE ( groupName , groupSpec . description ) ; } ) ; } return docs ; }
generate YuiDocs-style documentation
generate YuiDocs - style documentation