diff --git a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js b/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js index fb6a655991..7eaaeb3241 100644 --- a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js +++ b/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js @@ -51,18 +51,21 @@ module.exports = function addJadeDataDocsProcessor() { // GET DATA FOR EACH PAGE (CLASS, VARS, FUNCTIONS) var modulePageInfo = _(doc.exports) .map(function(exportDoc) { - return { + var dataDoc = { name: exportDoc.name + '-' + exportDoc.docType, title: exportDoc.name, - docType: exportDoc.docType, - varType: exportDoc.symbolTypeName && titleCase(exportDoc.symbolTypeName) + docType: exportDoc.docType }; + if (exportDoc.symbolTypeName) dataDoc.varType = titleCase(exportDoc.symbolTypeName); + if (exportDoc.originalModule) dataDoc.originalModule = exportDoc.originalModule; + return dataDoc; }) .sortBy('name') .value(); + //COMBINE PAGE DATA var allPageData = indexPageInfo.concat(modulePageInfo); diff --git a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js b/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js index 0aaa09a746..cc88c42fc4 100644 --- a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js +++ b/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js @@ -15,7 +15,9 @@ describe('addJadeDataDocsProcessor', function() { { docType: 'module', id: 'someModule', - exports: [{ name: 'someObj', docType: 'var', symbolTypeName: 'MyClass'}], + exports: [ + { name: 'someObj', docType: 'var', symbolTypeName: 'MyClass', originalModule: 'some/private/module' } + ], fileInfo: { baseName: 'x_y' }, description: 'some description\nsecond line' } @@ -29,7 +31,7 @@ describe('addJadeDataDocsProcessor', function() { originalDoc : docs[0], data : [ { name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' }, - { name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var' } + { name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var', originalModule: 'some/private/module' } ] }); }); @@ -53,11 +55,11 @@ describe('addJadeDataDocsProcessor', function() { expect(docs[1].data).toEqual([ { name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' }, - { name: 'Alpha-class', title: 'Alpha', varType : undefined, docType: 'class' }, - { name: 'Beta-class', title: 'Beta', varType : undefined, docType: 'class' }, - { name: 'Gamma-class', title: 'Gamma', varType : undefined, docType: 'class' }, - { name: 'Mu-class', title: 'Mu', varType : undefined, docType: 'class' }, - { name: 'Nu-class', title: 'Nu', varType : undefined, docType: 'class' } + { name: 'Alpha-class', title: 'Alpha', docType: 'class' }, + { name: 'Beta-class', title: 'Beta', docType: 'class' }, + { name: 'Gamma-class', title: 'Gamma', docType: 'class' }, + { name: 'Mu-class', title: 'Mu', docType: 'class' }, + { name: 'Nu-class', title: 'Nu', docType: 'class' } ]); }); diff --git a/public/api-builder/angular.io-package/templates/jade-data.template.html b/public/api-builder/angular.io-package/templates/jade-data.template.html index f19196de1e..a8c95ab1ee 100644 --- a/public/api-builder/angular.io-package/templates/jade-data.template.html +++ b/public/api-builder/angular.io-package/templates/jade-data.template.html @@ -8,6 +8,9 @@ {%- if item.varType %} "varType" : "{$ item.varType $}", {%- endif %} + {%- if item.originalModule %} + "originalModule" : "{$ item.originalModule $}", + {%- endif %} "docType": "{$ item.docType $}" }{% if not loop.last %},{% endif %} {% endfor -%}