2015-09-16 02:21:55 -04:00
|
|
|
var path = require('canonical-path');
|
|
|
|
var Package = require('dgeni').Package;
|
|
|
|
var basePackage = require('../public-docs-package');
|
|
|
|
|
2015-09-17 04:40:45 -04:00
|
|
|
// MIGRATION: removed these vars
|
|
|
|
// var PARTIAL_PATH = 'partials';
|
|
|
|
// var MODULES_DOCS_PATH = PARTIAL_PATH + '/api';
|
2015-09-16 02:21:55 -04:00
|
|
|
|
|
|
|
module.exports = new Package('angular.io', [basePackage])
|
|
|
|
|
|
|
|
.factory(require('./services/renderMarkdown'))
|
|
|
|
.processor(require('./processors/addJadeDataDocsProcessor'))
|
2015-09-17 04:40:45 -04:00
|
|
|
// MIGRATION: added this processor
|
|
|
|
.processor(require('./processors/fixOutputPathProcessor'))
|
2015-09-17 04:53:37 -04:00
|
|
|
// MIGRATION: added packageInfo to point to angular/angular repo
|
|
|
|
// overrides base packageInfo and returns the one for the 'angular/angular' repo.
|
2015-09-16 02:21:55 -04:00
|
|
|
.factory(require('./services/packageInfo'))
|
|
|
|
|
|
|
|
// Configure rendering
|
|
|
|
.config(function(templateFinder, templateEngine) {
|
|
|
|
|
|
|
|
templateFinder.templateFolders
|
|
|
|
.unshift(path.resolve(__dirname, 'templates'));
|
|
|
|
})
|
|
|
|
|
2015-09-17 04:53:37 -04:00
|
|
|
.config(function(writeFilesProcessor, readFilesProcessor) {
|
|
|
|
// MIGRATION: HACK - readFileProcessor.basePath set to point to a local repo location
|
|
|
|
// because the docs-package-processor will
|
|
|
|
// have previously set it to point to angular/angular repo.
|
|
|
|
// needed because the writeFilesProcessor uses the readFilesProcessor's basePath.
|
|
|
|
readFilesProcessor.basePath = path.resolve(__dirname, "../../docs");
|
2015-09-17 04:40:45 -04:00
|
|
|
writeFilesProcessor.outputFolder = 'js/latest/api';
|
2015-09-16 02:21:55 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
.config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) {
|
|
|
|
// Clear out unwanted processors
|
|
|
|
readFilesProcessor.$enabled = false;
|
|
|
|
generateNavigationDoc.$enabled = false;
|
|
|
|
createOverviewDump.$enabled = false;
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: ['module'],
|
|
|
|
pathTemplate: '${id}/',
|
2015-09-17 04:40:45 -04:00
|
|
|
// MIGRATION:
|
|
|
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.jade'
|
|
|
|
outputPathTemplate: '/${id}/index.jade'
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: EXPORT_DOC_TYPES,
|
|
|
|
pathTemplate: '${moduleDoc.id}/${name}-${docType}.html',
|
2015-09-17 04:40:45 -04:00
|
|
|
// MIGRATION:
|
|
|
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${moduleDoc.id}/${name}-${docType}.jade',
|
|
|
|
outputPathTemplate:'/${moduleDoc.id}/${name}-${docType}.jade',
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: ['jade-data'],
|
|
|
|
pathTemplate: '${originalDoc.id}/_data',
|
2015-09-17 04:40:45 -04:00
|
|
|
// MIGRATION:
|
|
|
|
// outputPathTemplate: MODULES_DOCS_PATH + '/${path}.json'
|
|
|
|
outputPathTemplate: '/${path}.json'
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
.config(function(getLinkInfo) {
|
|
|
|
getLinkInfo.relativeLinks = true;
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(templateEngine, getInjectables) {
|
|
|
|
templateEngine.filters = templateEngine.filters.concat(getInjectables([require('./rendering/trimBlankLines')]));
|
2015-09-17 20:04:58 -04:00
|
|
|
templateEngine.filters = templateEngine.filters.concat(getInjectables([require('./rendering/indentNonMixin')]));
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|