- add warning when bad example tag is encountered. - shredding for api docs + refactoring of gulpfile to clarify task names. - added top level gulp tasks + error handling cleanup - added test-api-builder gulp task - added warning messages during build-shred-map processing - mixin signature change - updated styleguide ... continued. - added @exampleTabs inlinetag support + refactoring shared services between @example and @exampleTabs - added new inline tag @linkDevGuide + cleanup - added angular source watch logic for serve-and-sync and source for examples changed from test -> examples + cleanup - promisify del - styleguide explanation of @example, @exampleTabs and @linkDevGuide
42 lines
955 B
JavaScript
42 lines
955 B
JavaScript
/**
|
|
* @dgService htmlFileShredder
|
|
* @description
|
|
*/
|
|
module.exports = function fileShredder(log, regionExtractor) {
|
|
return {
|
|
name: 'fileShredder',
|
|
|
|
getDocs: function (fileInfo) {
|
|
var commentMarkers;
|
|
switch (fileInfo.extension) {
|
|
case 'ts':
|
|
case 'js':
|
|
commentMarkers = ['//'];
|
|
break;
|
|
case 'html':
|
|
commentMarkers = ['<!--'];
|
|
break;
|
|
case 'css':
|
|
commentMarkers = ['/*'];
|
|
break;
|
|
case 'json':
|
|
break;
|
|
default:
|
|
return [];
|
|
}
|
|
var docs;
|
|
// log.info("fileShredder processing: " + fileInfo.relativePath);
|
|
if (commentMarkers) {
|
|
docs = regionExtractor(fileInfo.content, commentMarkers);
|
|
} else {
|
|
docs = [ { content: fileInfo.content } ];
|
|
}
|
|
if (docs.length) {
|
|
log.info("shredded file: " + fileInfo.relativePath);
|
|
}
|
|
return docs;
|
|
}
|
|
}
|
|
}
|
|
|