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

Commit d264610

Browse files
Eric Jimeneznaomiblack
Eric Jimenez
authored andcommitted
feat(dgeni audit): add more keys to the api-list, this makes it easier to see changes across the api
1 parent 6a1e6e3 commit d264610

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,34 @@ module.exports = function addJadeDataDocsProcessor() {
7676
stability = 'deprecated';
7777
}
7878

79+
var howToUse = '';
80+
if(_.has(exportDoc, 'howToUse')) {
81+
var howToUseArray = exportDoc.tags.tags.filter(function(tag) {
82+
return tag.tagName === 'howToUse'
83+
});
84+
85+
// Remove line breaks, there should only be one tag
86+
howToUse = howToUseArray[0].description.replace(/(\r\n|\n|\r)/gm,"");
87+
}
88+
89+
var whatItDoes = '';
90+
if(_.has(exportDoc, 'whatItDoes')) {
91+
var whatItDoesArray = exportDoc.tags.tags.filter(function(tag) {
92+
return tag.tagName === 'whatItDoes'
93+
});
94+
95+
// Remove line breaks, there should only be one tag
96+
whatItDoes = whatItDoesArray[0].description.replace(/(\r\n|\n|\r)/gm,"");
97+
}
98+
7999
var dataDoc = {
80100
name: exportDoc.name + '-' + exportDoc.docType,
81101
title: exportDoc.name,
82102
docType: exportDoc.docType,
83103
exportDoc: exportDoc,
84-
stability: stability
104+
stability: stability,
105+
howToUse: howToUse,
106+
whatItDoes: whatItDoes
85107
};
86108

87109
if (exportDoc.symbolTypeName) dataDoc.varType = titleCase(exportDoc.symbolTypeName);

tools/api-builder/angular.io-package/templates/api-list-data.template.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
{
55
"title": "{$ item.title $}",
66
"path": "{$ item.exportDoc.path $}",
7-
"docType": "{$ item.docType $}"
7+
"docType": "{$ item.docType $}",
8+
"stability": "{$ item.stability $}",
9+
"secure": "{$ item.security $}",
10+
"howToUse": "{$ item.howToUse $}",
11+
"whatItDoes": {% if item.whatItDoes %}"Exists"{% else %}"Not Done"{% endif %},
12+
"barrel" : "{$ module $}"
813
}{% if not loop.last %},{% endif %}
914
{% endfor %}]{% if not loop.last %},{% endif %}
1015
{% endfor -%}

0 commit comments

Comments
 (0)