mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This adds the new block syntax to dgeni docs pipeline, mainly copying the way that elements (`<ng-content>` etc.) work. Actual doc content is just a placeholder for this PR. PR Close #52123
24 lines
655 B
JavaScript
24 lines
655 B
JavaScript
const path = require('canonical-path');
|
|
|
|
module.exports = function processBlocks() {
|
|
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 'block' doc to its containing module/package.
|
|
if (doc.docType === 'block') {
|
|
doc.moduleDoc = moduleDocs[path.dirname(doc.fileInfo.relativePath)];
|
|
doc.moduleDoc.exports.push(doc);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
};
|