phaser/v2/tasks/jsdoc-plugins/sourceproxy.js

36 lines
944 B
JavaScript
Raw Normal View History

2014-11-25 00:20:56 +00:00
/**
2014-11-30 10:22:06 +00:00
* Moves information from custom `@sourcepath`, `@sourceline`, `@nosource` doclets
* into the doclet meta-information.
*
* This is useful to maintain source file/lineno links with the YUIDoc-to-JSDoc output.
2014-11-25 00:20:56 +00:00
*/
var path = require('path');
exports.defineTags = function(dictionary) {
dictionary.defineTag('nosource', {
onTagged: function (doclet, tag) {
doclet.meta.nosource = true;
//doclet.meta.path = '';
//doclet.meta.filename = '';
}
});
dictionary.defineTag('sourcefile', {
onTagged: function (doclet, tag) {
var filename = tag.value;
doclet.meta.path = path.dirname(filename);
doclet.meta.filename = path.basename(filename);
}
});
dictionary.defineTag('sourceline', {
onTagged: function (doclet, tag) {
var lineno = tag.value;
doclet.meta.lineno = lineno;
}
});
2014-11-25 00:48:40 +00:00
};