build(aio): refactor filterMemberDocs to be more general

Now it also filters function-overloads, hence the name change.
This commit is contained in:
Peter Bacon Darwin 2017-06-29 13:47:58 +01:00 committed by Pete Bacon Darwin
parent 433d479a1e
commit 57cfcb0830
3 changed files with 18 additions and 8 deletions

View File

@ -20,7 +20,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
.processor(require('./processors/mergeDecoratorDocs')) .processor(require('./processors/mergeDecoratorDocs'))
.processor(require('./processors/extractDecoratedClasses')) .processor(require('./processors/extractDecoratedClasses'))
.processor(require('./processors/matchUpDirectiveDecorators')) .processor(require('./processors/matchUpDirectiveDecorators'))
.processor(require('./processors/filterMemberDocs')) .processor(require('./processors/filterContainedDocs'))
.processor(require('./processors/markBarredODocsAsPrivate')) .processor(require('./processors/markBarredODocsAsPrivate'))
.processor(require('./processors/filterPrivateDocs')) .processor(require('./processors/filterPrivateDocs'))
.processor(require('./processors/computeSearchTitle')) .processor(require('./processors/computeSearchTitle'))

View File

@ -0,0 +1,17 @@
/**
* Remove docs that are contained in (owned by) another doc
* so that they don't get rendered as files in themselves.
*/
module.exports = function filterContainedDocs() {
return {
docTypes: ['member', 'function-overload'],
$runAfter: ['extra-docs-added'],
$runBefore: ['computing-paths'],
$process: function(docs) {
var docTypes = this.docTypes;
return docs.filter(function(doc) {
return docTypes.indexOf(doc.docType) === -1;
});
}
};
};

View File

@ -1,7 +0,0 @@
module.exports = function filterMemberDocs() {
return {
$runAfter: ['extra-docs-added'], $runBefore: ['computing-paths'], $process: function(docs) {
return docs.filter(function(doc) { return doc.docType !== 'member'; });
}
};
};