This commit adds support for generating pages that document special Angular elements, such as `ng-content` and `ng-template`, which have special behavior in Angular but are not directives nor components. Resolves #41273 PR Close #41299
25 lines
668 B
JavaScript
25 lines
668 B
JavaScript
const path = require('canonical-path');
|
|
|
|
module.exports = function processSpecialElements() {
|
|
return {
|
|
$runAfter: ['tags-extracted'],
|
|
$runBefore: ['collectPackageContentDocsProcessor'],
|
|
$process(docs) {
|
|
const moduleDocs = {};
|
|
docs.forEach(doc => {
|
|
if (doc.docType === 'module') {
|
|
moduleDocs[doc.id] = doc;
|
|
}
|
|
});
|
|
|
|
docs.forEach(doc => {
|
|
// Wire up each 'element' doc to its containing module/package.
|
|
if (doc.docType === 'element') {
|
|
doc.moduleDoc = moduleDocs[path.dirname(doc.fileInfo.relativePath)];
|
|
doc.moduleDoc.exports.push(doc);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
};
|