mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
checking in jsdoc dir so people can generate docs themselves
This commit is contained in:
17
jsdoc-master/plugins/commentsOnly.js
Normal file
17
jsdoc-master/plugins/commentsOnly.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @overview Remove everything in a file except JSDoc-style comments. By enabling this plugin, you
|
||||
* can document source files that are not valid JavaScript (including source files for other
|
||||
* languages).
|
||||
* @module plugins/commentsOnly
|
||||
* @author Jeff Williams <jeffrey.l.williams@gmail.com>
|
||||
*/
|
||||
|
||||
exports.handlers = {
|
||||
beforeParse: function(e) {
|
||||
// a JSDoc comment looks like: /**[one or more chars]*/
|
||||
var comments = e.source.match(/\/\*\*[\s\S]+?\*\//g);
|
||||
if (comments) {
|
||||
e.source = comments.join('\n\n');
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user