mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(dgeni): fix typo in method name (#9892)
* Fixes a minor typo in the `MergeInheritedProperties` processor. * Fixes an incorrectly placed comment inside of `decorators.ts`. * Cleans up the `dgeni/index.ts` file
This commit is contained in:
committed by
Jeremy Elbourn
parent
47ab3367b9
commit
7feaeb1f9e
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
|
||||
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
|
||||
* that should not be emitted in the documentation.
|
||||
*/
|
||||
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
|
||||
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
|
||||
import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
|
||||
import {CategorizedClassDoc, DeprecationDoc, HasDecoratorsDoc} from './dgeni-definitions';
|
||||
|
||||
/**
|
||||
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
|
||||
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
|
||||
* that should not be emitted in the documentation.
|
||||
*/
|
||||
const SELECTOR_BLACKLIST = new Set([
|
||||
'[portal]',
|
||||
'[portalHost]',
|
||||
|
||||
+21
-22
@@ -11,7 +11,7 @@ import {TsParser} from 'dgeni-packages/typescript/services/TsParser';
|
||||
import {sync as globSync} from 'glob';
|
||||
import * as path from 'path';
|
||||
|
||||
// Dgeni packages
|
||||
// Dgeni packages that the Material docs package depends on.
|
||||
const jsdocPackage = require('dgeni-packages/jsdoc');
|
||||
const nunjucksPackage = require('dgeni-packages/nunjucks');
|
||||
const typescriptPackage = require('dgeni-packages/typescript');
|
||||
@@ -22,24 +22,6 @@ const sourceDir = path.resolve(projectRootDir, 'src');
|
||||
const outputDir = path.resolve(projectRootDir, 'dist/docs/api');
|
||||
const templateDir = path.resolve(__dirname, './templates');
|
||||
|
||||
// Package definition for material2 api docs. This only *defines* the package- it does not yet
|
||||
// actually *run* anything.
|
||||
//
|
||||
// A dgeni package is very similar to an AngularJS module. Modules contain:
|
||||
// "services" (injectables)
|
||||
// "processors" (injectables that conform to a specific interface)
|
||||
// "templates": nunjucks templates that can be used to render content
|
||||
//
|
||||
// A dgeni package also has a `config` method, similar to an AngularJS module.
|
||||
// A config block can inject any services/processors and configure them before
|
||||
// docs processing begins.
|
||||
|
||||
const dgeniPackageDeps = [
|
||||
jsdocPackage,
|
||||
nunjucksPackage,
|
||||
typescriptPackage,
|
||||
];
|
||||
|
||||
/** List of CDK packages that need to be documented. */
|
||||
const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
|
||||
.filter(packagePath => !packagePath.endsWith('testing/'))
|
||||
@@ -49,7 +31,24 @@ const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
|
||||
const materialPackages = globSync(path.join(sourceDir, 'lib', '*/'))
|
||||
.map(packagePath => path.basename(packagePath));
|
||||
|
||||
export const apiDocsPackage = new Package('material2-api-docs', dgeniPackageDeps);
|
||||
/**
|
||||
* Dgeni package for the Angular Material docs. This just defines the package, but doesn't
|
||||
* generate the docs yet.
|
||||
*
|
||||
* Dgeni packages are very similar to AngularJS modules. Those can contain:
|
||||
*
|
||||
* - Services that can be injected
|
||||
* - Templates that are used to convert the data into HTML output.
|
||||
* - Processors that can modify the doc items (like a build pipeline).
|
||||
*
|
||||
* Similar to AngularJS, there is also a `config` lifecycle hook, that can be used to
|
||||
* configure specific processors, services before the procession begins.
|
||||
*/
|
||||
export const apiDocsPackage = new Package('material2-api-docs', [
|
||||
jsdocPackage,
|
||||
nunjucksPackage,
|
||||
typescriptPackage,
|
||||
]);
|
||||
|
||||
// Processor that filters out duplicate exports that should not be shown in the docs.
|
||||
apiDocsPackage.processor(new FilterDuplicateExports());
|
||||
@@ -121,7 +120,7 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
|
||||
tsParser.options.paths = typescriptPathMap;
|
||||
tsParser.options.baseUrl = sourceDir;
|
||||
|
||||
// Entry points for docs generation. All publically exported symbols found through these
|
||||
// Entry points for docs generation. All publicly exported symbols found through these
|
||||
// files will have docs generated.
|
||||
readTypeScriptModules.sourceFiles = [
|
||||
...cdkPackages.map(packageName => `./cdk/${packageName}/index.ts`),
|
||||
@@ -149,7 +148,7 @@ apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
|
||||
'common.template.html'
|
||||
];
|
||||
|
||||
// dgeni disables autoescape by default, but we want this turned on.
|
||||
// Dgeni disables autoescape by default, but we want this turned on.
|
||||
templateEngine.config.autoescape = true;
|
||||
|
||||
// Nunjucks and Angular conflict in their template bindings so change Nunjucks
|
||||
|
||||
@@ -13,10 +13,10 @@ export class MergeInheritedProperties implements Processor {
|
||||
$process(docs: DocCollection) {
|
||||
return docs
|
||||
.filter(doc => doc.docType === 'class')
|
||||
.forEach(doc => this.addInhertiedProperties(doc));
|
||||
.forEach(doc => this.addInheritedProperties(doc));
|
||||
}
|
||||
|
||||
private addInhertiedProperties(doc: ClassExportDoc) {
|
||||
private addInheritedProperties(doc: ClassExportDoc) {
|
||||
doc.implementsClauses.filter(clause => clause.doc).forEach(clause => {
|
||||
clause.doc!.members.forEach(member => this.addMemberDocIfNotPresent(doc, member));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user