Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 2fb503d

Browse files
petebacondarwinnaomiblack
authored andcommitted
doc-gen: fix filterable API list
Closes #2054
1 parent ef1171b commit 2fb503d

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

tools/api-builder/angular.io-package/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe
138138
});
139139

140140
computePathsProcessor.pathTemplates.push({
141-
docTypes: ['api-list-data'],
141+
docTypes: ['api-list-audit'],
142142
pathTemplate: 'api-list-audit.json',
143143
outputPathTemplate: '${path}'
144144
});

tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,26 @@ module.exports = function addJadeDataDocsProcessor() {
2626
$process: function(docs) {
2727
var extraDocs = [];
2828
var modules = [];
29+
var data = {};
2930

3031
var appDataDoc = {
3132
id: 'api-list-data',
3233
aliases: ['api-list-data'],
3334
docType: 'api-list-data',
34-
data: {}
35+
data: data
3536
};
3637
extraDocs.push(appDataDoc);
3738

39+
// create additional doc for auditing
40+
var appDataAuditDoc = {
41+
id: 'api-list-audit',
42+
aliases: ['api-list-audit'],
43+
docType: 'api-list-audit',
44+
data: data
45+
};
46+
extraDocs.push(appDataAuditDoc);
47+
48+
3849
/*
3950
* Create Data for Modules
4051
*
@@ -76,7 +87,7 @@ module.exports = function addJadeDataDocsProcessor() {
7687
stability = 'deprecated';
7788
exportDoc.showDeprecatedNotes = true;
7889
}
79-
90+
8091
var howToUse = '';
8192
if(_.has(exportDoc, 'howToUse')) {
8293
var howToUseArray = exportDoc.tags.tags.filter(function(tag) {
@@ -135,7 +146,7 @@ module.exports = function addJadeDataDocsProcessor() {
135146
doc.childPages = modulePageInfo;
136147

137148
// ADD TO APP DATA DOC
138-
appDataDoc.data[doc.id] = modulePageInfo;
149+
data[doc.id] = modulePageInfo;
139150

140151
// COMBINE WITH INDEX PAGE DATA
141152
var allPageData = indexPageInfo.concat(modulePageInfo);

tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,18 @@ describe('addJadeDataDocsProcessor', function() {
3232
originalDoc : docs[0],
3333
data : [
3434
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
35-
{ name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var',
36-
originalModule: 'some/private/module', exportDoc: exportDoc }
35+
{
36+
name : 'someObj-var',
37+
title : 'someObj',
38+
varType : 'MyClass',
39+
docType: 'var',
40+
originalModule: 'some/private/module',
41+
exportDoc: exportDoc,
42+
stability : '',
43+
howToUse : '',
44+
whatItDoes : '',
45+
security : false
46+
}
3747
] });
3848
});
3949

@@ -56,14 +66,13 @@ describe('addJadeDataDocsProcessor', function() {
5666
];
5767
docs = processor.$process(docs);
5868

59-
expect(docs[2].data).toEqual([
60-
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
61-
{ name: 'Alpha-class', title: 'Alpha', docType: 'class', exportDoc: alpha },
62-
{ name: 'Beta-class', title: 'Beta', docType: 'class', exportDoc: beta },
63-
{ name: 'Gamma-class', title: 'Gamma', docType: 'class', exportDoc: gamma },
64-
{ name: 'Mu-class', title: 'Mu', docType: 'class', exportDoc: mu },
65-
{ name: 'Nu-class', title: 'Nu', docType: 'class', exportDoc: nu }
66-
]);
69+
expect(docs[2].data).toEqual({ someModule : [
70+
{ name: 'Alpha-class', title: 'Alpha', docType: 'class', exportDoc: alpha, stability : '', howToUse : '', whatItDoes : '', security : false },
71+
{ name: 'Beta-class', title: 'Beta', docType: 'class', exportDoc: beta, stability : '', howToUse : '', whatItDoes : '', security : false },
72+
{ name: 'Gamma-class', title: 'Gamma', docType: 'class', exportDoc: gamma, stability : '', howToUse : '', whatItDoes : '', security : false },
73+
{ name: 'Mu-class', title: 'Mu', docType: 'class', exportDoc: mu, stability : '', howToUse : '', whatItDoes : '', security : false },
74+
{ name: 'Nu-class', title: 'Nu', docType: 'class', exportDoc: nu, stability : '', howToUse : '', whatItDoes : '', security : false }
75+
]});
6776

6877
});
6978
});

0 commit comments

Comments
 (0)