Skip to content

Commit 4ba0277

Browse files
devversionandrewseguin
authored andcommitted
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
1 parent 739f99c commit 4ba0277

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

tools/dgeni/common/decorators.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
/**
2-
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
3-
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
4-
* that should not be emitted in the documentation.
5-
*/
61
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
72
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
83
import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
94
import {CategorizedClassDoc, DeprecationDoc, HasDecoratorsDoc} from './dgeni-definitions';
105

6+
/**
7+
* We want to avoid emitting selectors that are deprecated but don't have a way to mark
8+
* them as such in the source code. Thus, we maintain a separate blacklist of selectors
9+
* that should not be emitted in the documentation.
10+
*/
1111
const SELECTOR_BLACKLIST = new Set([
1212
'[portal]',
1313
'[portalHost]',

tools/dgeni/index.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {TsParser} from 'dgeni-packages/typescript/services/TsParser';
1111
import {sync as globSync} from 'glob';
1212
import * as path from 'path';
1313

14-
// Dgeni packages
14+
// Dgeni packages that the Material docs package depends on.
1515
const jsdocPackage = require('dgeni-packages/jsdoc');
1616
const nunjucksPackage = require('dgeni-packages/nunjucks');
1717
const typescriptPackage = require('dgeni-packages/typescript');
@@ -22,24 +22,6 @@ const sourceDir = path.resolve(projectRootDir, 'src');
2222
const outputDir = path.resolve(projectRootDir, 'dist/docs/api');
2323
const templateDir = path.resolve(__dirname, './templates');
2424

25-
// Package definition for material2 api docs. This only *defines* the package- it does not yet
26-
// actually *run* anything.
27-
//
28-
// A dgeni package is very similar to an AngularJS module. Modules contain:
29-
// "services" (injectables)
30-
// "processors" (injectables that conform to a specific interface)
31-
// "templates": nunjucks templates that can be used to render content
32-
//
33-
// A dgeni package also has a `config` method, similar to an AngularJS module.
34-
// A config block can inject any services/processors and configure them before
35-
// docs processing begins.
36-
37-
const dgeniPackageDeps = [
38-
jsdocPackage,
39-
nunjucksPackage,
40-
typescriptPackage,
41-
];
42-
4325
/** List of CDK packages that need to be documented. */
4426
const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
4527
.filter(packagePath => !packagePath.endsWith('testing/'))
@@ -49,7 +31,24 @@ const cdkPackages = globSync(path.join(sourceDir, 'cdk', '*/'))
4931
const materialPackages = globSync(path.join(sourceDir, 'lib', '*/'))
5032
.map(packagePath => path.basename(packagePath));
5133

52-
export const apiDocsPackage = new Package('material2-api-docs', dgeniPackageDeps);
34+
/**
35+
* Dgeni package for the Angular Material docs. This just defines the package, but doesn't
36+
* generate the docs yet.
37+
*
38+
* Dgeni packages are very similar to AngularJS modules. Those can contain:
39+
*
40+
* - Services that can be injected
41+
* - Templates that are used to convert the data into HTML output.
42+
* - Processors that can modify the doc items (like a build pipeline).
43+
*
44+
* Similar to AngularJS, there is also a `config` lifecycle hook, that can be used to
45+
* configure specific processors, services before the procession begins.
46+
*/
47+
export const apiDocsPackage = new Package('material2-api-docs', [
48+
jsdocPackage,
49+
nunjucksPackage,
50+
typescriptPackage,
51+
]);
5352

5453
// Processor that filters out duplicate exports that should not be shown in the docs.
5554
apiDocsPackage.processor(new FilterDuplicateExports());
@@ -121,7 +120,7 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
121120
tsParser.options.paths = typescriptPathMap;
122121
tsParser.options.baseUrl = sourceDir;
123122

124-
// Entry points for docs generation. All publically exported symbols found through these
123+
// Entry points for docs generation. All publicly exported symbols found through these
125124
// files will have docs generated.
126125
readTypeScriptModules.sourceFiles = [
127126
...cdkPackages.map(packageName => `./cdk/${packageName}/index.ts`),
@@ -149,7 +148,7 @@ apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
149148
'common.template.html'
150149
];
151150

152-
// dgeni disables autoescape by default, but we want this turned on.
151+
// Dgeni disables autoescape by default, but we want this turned on.
153152
templateEngine.config.autoescape = true;
154153

155154
// Nunjucks and Angular conflict in their template bindings so change Nunjucks

tools/dgeni/processors/merge-inherited-properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export class MergeInheritedProperties implements Processor {
1313
$process(docs: DocCollection) {
1414
return docs
1515
.filter(doc => doc.docType === 'class')
16-
.forEach(doc => this.addInhertiedProperties(doc));
16+
.forEach(doc => this.addInheritedProperties(doc));
1717
}
1818

19-
private addInhertiedProperties(doc: ClassExportDoc) {
19+
private addInheritedProperties(doc: ClassExportDoc) {
2020
doc.implementsClauses.filter(clause => clause.doc).forEach(clause => {
2121
clause.doc!.members.forEach(member => this.addMemberDocIfNotPresent(doc, member));
2222
});

0 commit comments

Comments
 (0)