cleanup/comment api builder
This commit is contained in:
parent
3f6a9833dd
commit
834b65dca3
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ typings
|
|||||||
www
|
www
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
|
**/js/latest/api
|
@ -2,17 +2,16 @@ var path = require('canonical-path');
|
|||||||
var Package = require('dgeni').Package;
|
var Package = require('dgeni').Package;
|
||||||
var basePackage = require('../public-docs-package');
|
var basePackage = require('../public-docs-package');
|
||||||
|
|
||||||
var PARTIAL_PATH = 'partials';
|
// MIGRATION: removed these vars
|
||||||
var MODULES_DOCS_PATH = PARTIAL_PATH + '/api';
|
// var PARTIAL_PATH = 'partials';
|
||||||
|
// var MODULES_DOCS_PATH = PARTIAL_PATH + '/api';
|
||||||
// OLD paths
|
|
||||||
// var DOCS_DIST = 'dist/angular.io/partials/api/angular2/';
|
|
||||||
// var DOCS_IO_DIST = '../angular.io/public/docs/js/latest/api/';
|
|
||||||
|
|
||||||
module.exports = new Package('angular.io', [basePackage])
|
module.exports = new Package('angular.io', [basePackage])
|
||||||
|
|
||||||
.factory(require('./services/renderMarkdown'))
|
.factory(require('./services/renderMarkdown'))
|
||||||
.processor(require('./processors/addJadeDataDocsProcessor'))
|
.processor(require('./processors/addJadeDataDocsProcessor'))
|
||||||
|
// MIGRATION: added this processor
|
||||||
|
.processor(require('./processors/fixOutputPathProcessor'))
|
||||||
// overrides base packageInfo and returns the one for the 'angular/angular' repo.
|
// overrides base packageInfo and returns the one for the 'angular/angular' repo.
|
||||||
.factory(require('./services/packageInfo'))
|
.factory(require('./services/packageInfo'))
|
||||||
|
|
||||||
@ -24,37 +23,44 @@ module.exports = new Package('angular.io', [basePackage])
|
|||||||
})
|
})
|
||||||
|
|
||||||
.config(function(writeFilesProcessor) {
|
.config(function(writeFilesProcessor) {
|
||||||
writeFilesProcessor.outputFolder = 'dist/angular.io';
|
writeFilesProcessor.outputFolder = 'js/latest/api';
|
||||||
})
|
})
|
||||||
|
|
||||||
.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) {
|
.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) {
|
||||||
// Clear out unwanted processors
|
// Clear out unwanted processors
|
||||||
|
// MIGRATION: HACK - added basePath to point to a local repo location because the docs-package-processor will
|
||||||
|
// have previously set it to point to angular/angular repo.
|
||||||
|
readFilesProcessor.basePath = path.resolve(__dirname, "../../docs");
|
||||||
readFilesProcessor.$enabled = false;
|
readFilesProcessor.$enabled = false;
|
||||||
generateNavigationDoc.$enabled = false;
|
generateNavigationDoc.$enabled = false;
|
||||||
createOverviewDump.$enabled = false;
|
createOverviewDump.$enabled = false;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
|
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
|
||||||
|
|
||||||
computePathsProcessor.pathTemplates.push({
|
computePathsProcessor.pathTemplates.push({
|
||||||
docTypes: ['module'],
|
docTypes: ['module'],
|
||||||
pathTemplate: '${id}/',
|
pathTemplate: '${id}/',
|
||||||
outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.jade'
|
// MIGRATION:
|
||||||
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.jade'
|
||||||
|
outputPathTemplate: '/${id}/index.jade'
|
||||||
});
|
});
|
||||||
|
|
||||||
computePathsProcessor.pathTemplates.push({
|
computePathsProcessor.pathTemplates.push({
|
||||||
docTypes: EXPORT_DOC_TYPES,
|
docTypes: EXPORT_DOC_TYPES,
|
||||||
pathTemplate: '${moduleDoc.id}/${name}-${docType}.html',
|
pathTemplate: '${moduleDoc.id}/${name}-${docType}.html',
|
||||||
outputPathTemplate: MODULES_DOCS_PATH + '/${moduleDoc.id}/${name}-${docType}.jade',
|
// MIGRATION:
|
||||||
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${moduleDoc.id}/${name}-${docType}.jade',
|
||||||
|
outputPathTemplate:'/${moduleDoc.id}/${name}-${docType}.jade',
|
||||||
});
|
});
|
||||||
|
|
||||||
computePathsProcessor.pathTemplates.push({
|
computePathsProcessor.pathTemplates.push({
|
||||||
docTypes: ['jade-data'],
|
docTypes: ['jade-data'],
|
||||||
pathTemplate: '${originalDoc.id}/_data',
|
pathTemplate: '${originalDoc.id}/_data',
|
||||||
outputPathTemplate: MODULES_DOCS_PATH + '/${path}.json'
|
// MIGRATION:
|
||||||
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${path}.json'
|
||||||
|
outputPathTemplate: '/${path}.json'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
var _ = require('lodash');
|
||||||
|
var path = require('canonical-path');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove angular2 prefix from all doc output paths
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = function fixOutputPathProcessor() {
|
||||||
|
return {
|
||||||
|
$runAfter: ['paths-computed'],
|
||||||
|
$runBefore: ['writing-files'],
|
||||||
|
$process: function(docs) {
|
||||||
|
docs.forEach(function(doc) {
|
||||||
|
try {
|
||||||
|
doc.outputPath = doc.outputPath && path.relative("/angular2", doc.outputPath);
|
||||||
|
} catch(e) {
|
||||||
|
var x = e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return docs;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
@ -8,7 +8,7 @@ p.location-badge.
|
|||||||
defined in {$ githubViewLink(doc) $}
|
defined in {$ githubViewLink(doc) $}
|
||||||
|
|
||||||
:markdown
|
:markdown
|
||||||
{$ doc.moduleDoc.description | indent(2, true) | trimBlankLines $}
|
{$ doc.description | indent(2, true) | trimBlankLines $}
|
||||||
|
|
||||||
{%- if doc.decorators %}
|
{%- if doc.decorators %}
|
||||||
.l-main-section
|
.l-main-section
|
||||||
|
@ -33,6 +33,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
|
|||||||
// Configure file reading
|
// Configure file reading
|
||||||
.config(function(readFilesProcessor, ngdocFileReader, readTypeScriptModules) {
|
.config(function(readFilesProcessor, ngdocFileReader, readTypeScriptModules) {
|
||||||
readFilesProcessor.fileReaders = [ngdocFileReader];
|
readFilesProcessor.fileReaders = [ngdocFileReader];
|
||||||
|
// MIGRATION: set the readFilesProcessor base path to point to angular repo.
|
||||||
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
|
var angular_repo_path = path.resolve(__dirname, '../../../../angular');
|
||||||
// TODO: confirm that the angular repo is actually there.
|
// TODO: confirm that the angular repo is actually there.
|
||||||
if (!fs.existsSync(angular_repo_path)) {
|
if (!fs.existsSync(angular_repo_path)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user