From 04917bd75ad35cdd21264d55094af21035c266cb Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 19 May 2016 20:56:06 +0100 Subject: [PATCH 1/3] api-builder: fix githublinks Closes #1435 Closes #1433 --- .../angular.io-package/templates/lib/githubLinks.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html index 611ebdb13a..4bf27cd15c 100644 --- a/tools/api-builder/angular.io-package/templates/lib/githubLinks.html +++ b/tools/api-builder/angular.io-package/templates/lib/githubLinks.html @@ -1,7 +1,7 @@ {% macro githubHref(doc) -%} -https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/modules/{$ doc.fileInfo.relativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $} +https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/modules/{$ doc.fileInfo.projectRelativePath $}#L{$ doc.location.start.line+1 $}-L{$ doc.location.end.line+1 $} {%- endmacro %} {% macro githubViewLink(doc) -%} - {$ doc.fileInfo.relativePath $} (line {$ doc.location.start.line+1 $}) -{%- endmacro -%} + {$ doc.fileInfo.projectRelativePath $} (line {$ doc.location.start.line+1 $}) +{%- endmacro %} \ No newline at end of file From adb5143202615ba28ac70de4714fe8aa6e23f6b4 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 19 May 2016 20:56:30 +0100 Subject: [PATCH 2/3] api-builder: fix class github link formatting --- .../angular.io-package/templates/class.template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index 7390604888..016ce47923 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -159,7 +159,7 @@ {% endif %}{% endfor %} {% endif %} -.p(class="location-badge") +p(class="location-badge"). exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} From 2c8940d527cac1725659157a29de5e48b4f7fb59 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Thu, 19 May 2016 20:57:15 +0100 Subject: [PATCH 3/3] api-builder: consolidate readTypescriptProcessor configuration --- tools/api-builder/angular.io-package/index.js | 17 +++++++++++++ tools/api-builder/docs-package/index.js | 24 ------------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/tools/api-builder/angular.io-package/index.js b/tools/api-builder/angular.io-package/index.js index add8a222d1..a1194e6d7e 100644 --- a/tools/api-builder/angular.io-package/index.js +++ b/tools/api-builder/angular.io-package/index.js @@ -1,3 +1,4 @@ +var fs = require('fs'); var path = require('canonical-path'); var Package = require('dgeni').Package; var basePackage = require('../docs-package'); @@ -40,6 +41,21 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe .config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) { + var angular_repo_path = path.resolve(__dirname, '../../../../angular'); + // confirm that the angular repo is actually there. + if (!fs.existsSync(angular_repo_path)) { + throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path); + } + readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules'); + readTypeScriptModules.ignoreExportsMatching = [ + '___esModule', + '___core_private_types__', + '___platform_browser_private__', + '___compiler_private__', + '__core_private__', + '___core_private__' + ]; + readTypeScriptModules.sourceFiles = [ '@angular/common/index.ts', '@angular/common/testing.ts', @@ -61,6 +77,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe ]; readTypeScriptModules.hidePrivateMembers = true; + readFilesProcessor.basePath = DOCS_PATH; readFilesProcessor.sourceFiles = [{ basePath: ANGULAR2_DOCS_PATH, diff --git a/tools/api-builder/docs-package/index.js b/tools/api-builder/docs-package/index.js index 047ef45ad6..5988639330 100644 --- a/tools/api-builder/docs-package/index.js +++ b/tools/api-builder/docs-package/index.js @@ -5,7 +5,6 @@ var typescriptPackage = require('dgeni-packages/typescript'); var linksPackage = require('../links-package'); var gitPackage = require('dgeni-packages/git'); var path = require('canonical-path'); -var fs = require('fs'); // Define the dgeni package for generating the docs module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, typescriptPackage, linksPackage, gitPackage]) @@ -36,29 +35,6 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage, renderDocsProcessor.extraData.versionInfo = versionInfo; }) -// Configure file reading -.config(function(readTypeScriptModules) { - - var angular_repo_path = path.resolve(__dirname, '../../../../angular'); - // confirm that the angular repo is actually there. - if (!fs.existsSync(angular_repo_path)) { - throw new Error('build-api-docs task requires the angular2 repo to be at ' + angular_repo_path); - } - readTypeScriptModules.sourceFiles = [ - '*/*.@(js|es6|ts)', - '*/src/**/*.@(js|es6|ts)' - ]; - readTypeScriptModules.basePath = path.resolve(angular_repo_path, 'modules'); - readTypeScriptModules.ignoreExportsMatching = [ - '___esModule', - '___core_private_types__', - '___platform_browser_private__', - '___compiler_private__', - '__core_private__', - '___core_private__' - ]; -}) - .config(function(parseTagsProcessor, getInjectables) { // We actually don't want to parse param docs in this package as we are getting the data out using TS