2015-09-16 02:21:55 -04:00
|
|
|
var path = require('canonical-path');
|
|
|
|
var Package = require('dgeni').Package;
|
2015-09-18 08:05:20 -04:00
|
|
|
var basePackage = require('../docs-package');
|
2015-09-16 02:21:55 -04:00
|
|
|
|
|
|
|
module.exports = new Package('angular.io', [basePackage])
|
|
|
|
|
|
|
|
.factory(require('./services/renderMarkdown'))
|
|
|
|
.processor(require('./processors/addJadeDataDocsProcessor'))
|
2015-10-17 11:46:19 -04:00
|
|
|
.processor(require('./processors/filterUnwantedDecorators'))
|
2015-09-30 04:13:23 -04:00
|
|
|
.processor(require('./processors/extractDirectiveClasses'))
|
|
|
|
.processor(require('./processors/matchUpDirectiveDecorators'))
|
|
|
|
|
2015-09-17 04:53:37 -04:00
|
|
|
// 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-10-02 17:44:57 -04:00
|
|
|
.config(function(parseTagsProcessor) {
|
|
|
|
parseTagsProcessor.tagDefinitions.push({ name: 'internal', transforms: function() { return true; } });
|
|
|
|
})
|
|
|
|
|
2015-09-18 08:05:20 -04:00
|
|
|
.config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) {
|
|
|
|
|
|
|
|
readTypeScriptModules.sourceFiles = [
|
|
|
|
'angular2/lifecycle_hooks.ts',
|
|
|
|
'angular2/core.ts',
|
|
|
|
'angular2/http.ts',
|
|
|
|
'angular2/router.ts',
|
|
|
|
'angular2/test.ts'
|
|
|
|
];
|
|
|
|
readTypeScriptModules.hidePrivateMembers = true;
|
|
|
|
|
2015-09-17 04:53:37 -04:00
|
|
|
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
|
|
|
})
|
|
|
|
|
2015-09-18 08:05:20 -04:00
|
|
|
.config(function(getLinkInfo) {
|
|
|
|
getLinkInfo.useFirstAmbiguousLink = false;
|
|
|
|
})
|
|
|
|
|
|
|
|
|
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'],
|
2015-09-18 08:05:58 -04:00
|
|
|
getPath: function computeModulePath(doc) {
|
|
|
|
return doc.id.replace(/^angular2\//, '');
|
|
|
|
},
|
|
|
|
outputPathTemplate: '${path}/index.jade'
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: EXPORT_DOC_TYPES,
|
2015-09-18 08:05:58 -04:00
|
|
|
pathTemplate: '${moduleDoc.path}/${name}-${docType}.html',
|
|
|
|
outputPathTemplate:'${moduleDoc.path}/${name}-${docType}.jade',
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: ['jade-data'],
|
2015-09-18 08:05:58 -04:00
|
|
|
pathTemplate: '${originalDoc.path}/_data',
|
|
|
|
outputPathTemplate: '${path}.json'
|
2015-09-16 02:21:55 -04:00
|
|
|
});
|
2015-11-03 11:41:38 -05:00
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
docTypes: ['app-data'],
|
|
|
|
pathTemplate: '../../../../resources/js/app-data',
|
|
|
|
outputPathTemplate: '${path}.json'
|
|
|
|
});
|
2015-09-16 02:21:55 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
.config(function(getLinkInfo) {
|
|
|
|
getLinkInfo.relativeLinks = true;
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(templateEngine, getInjectables) {
|
2015-09-18 16:25:18 -04:00
|
|
|
templateEngine.filters = templateEngine.filters.concat(getInjectables([
|
|
|
|
require('./rendering/trimBlankLines'),
|
|
|
|
require('./rendering/toId'),
|
|
|
|
require('./rendering/indentForMarkdown')
|
|
|
|
]));
|
|
|
|
})
|
2015-09-16 02:21:55 -04:00
|
|
|
|
2015-10-17 11:46:19 -04:00
|
|
|
.config(function(filterUnwantedDecorators, log) {
|
|
|
|
log.level = 'info';
|
|
|
|
filterUnwantedDecorators.decoratorsToIgnore = [
|
|
|
|
'CONST',
|
|
|
|
'IMPLEMENTS',
|
|
|
|
'ABSTRACT'
|
|
|
|
];
|
|
|
|
})
|
2015-09-16 02:21:55 -04:00
|
|
|
|