mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build(docs): fix description comments sometimes empty (#12885)
Follow-up commit for 4879dc4720.
---
Disables concatenation of multiple leading comments for a TypeScript node. Since all shipped source files have a license banner at top, the license banner comment would be incorrectly considered as "comment" for the first TypeScript node of a given file. Since there are various files in the Material project where the first node of a source file is exported and should only use the first leading comment, we need to disable comment concatenation.
See for example: https://github.com/angular/material2/blob/master/src/cdk/coercion/boolean-property.ts
This commit is contained in:
committed by
Jeremy Elbourn
parent
8087ccb0b2
commit
53b4af6d2a
@@ -1,4 +1,5 @@
|
||||
import {Package} from 'dgeni';
|
||||
import {Host} from 'dgeni-packages/typescript/services/ts-host/host';
|
||||
import {patchLogService} from './patch-log-service';
|
||||
import {DocsPrivateFilter} from './processors/docs-private-filter';
|
||||
import {Categorizer} from './processors/categorizer';
|
||||
@@ -124,6 +125,16 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
|
||||
];
|
||||
});
|
||||
|
||||
apiDocsPackage.config((tsHost: Host) => {
|
||||
// Disable concatenation of multiple leading comments for a TypeScript node. Since all shipped
|
||||
// source files have a license banner at top, the license banner comment would be incorrectly
|
||||
// considered as "comment" for the first TypeScript node of a given file. Since there are
|
||||
// various files in the Material project where the first node of a source file is exported and
|
||||
// should only use the first leading comment, we need to disable comment concatenation.
|
||||
// See for example: src/cdk/coercion/boolean-property.ts
|
||||
tsHost.concatMultipleLeadingComments = false;
|
||||
});
|
||||
|
||||
// Configure processor for finding nunjucks templates.
|
||||
apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
|
||||
// Where to find the templates for the doc rendering
|
||||
|
||||
Reference in New Issue
Block a user