2016-08-10 12:13:14 +02:00
|
|
|
'use strict';
|
2014-09-12 23:04:35 +01:00
|
|
|
|
2014-02-12 22:47:42 +00:00
|
|
|
var path = require('canonical-path');
|
|
|
|
|
var packagePath = __dirname;
|
|
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
var Package = require('dgeni').Package;
|
|
|
|
|
|
2014-10-27 13:37:51 +01:00
|
|
|
// Create and export a new Dgeni package called angularjs. This package depends upon
|
2016-11-26 21:59:42 +00:00
|
|
|
// the ngdoc, nunjucks, and examples packages defined in the dgeni-packages node module.
|
2014-09-12 23:04:35 +01:00
|
|
|
module.exports = new Package('angularjs', [
|
|
|
|
|
require('dgeni-packages/ngdoc'),
|
|
|
|
|
require('dgeni-packages/nunjucks'),
|
2015-06-22 15:52:25 -07:00
|
|
|
require('dgeni-packages/examples'),
|
|
|
|
|
require('dgeni-packages/git')
|
2014-09-12 23:04:35 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.factory(require('./services/errorNamespaceMap'))
|
|
|
|
|
.factory(require('./services/getMinerrInfo'))
|
|
|
|
|
.factory(require('./services/getVersion'))
|
|
|
|
|
|
|
|
|
|
.factory(require('./services/deployments/debug'))
|
|
|
|
|
.factory(require('./services/deployments/default'))
|
|
|
|
|
.factory(require('./services/deployments/jquery'))
|
2018-02-20 17:59:45 +01:00
|
|
|
.factory(require('./services/deployments/test'))
|
2014-09-12 23:04:35 +01:00
|
|
|
.factory(require('./services/deployments/production'))
|
|
|
|
|
|
|
|
|
|
.factory(require('./inline-tag-defs/type'))
|
|
|
|
|
|
|
|
|
|
.processor(require('./processors/error-docs'))
|
|
|
|
|
.processor(require('./processors/index-page'))
|
|
|
|
|
.processor(require('./processors/keywords'))
|
|
|
|
|
.processor(require('./processors/pages-data'))
|
|
|
|
|
.processor(require('./processors/versions-data'))
|
2018-02-05 12:35:12 +01:00
|
|
|
.processor(require('./processors/sitemap'))
|
2014-09-12 23:04:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(dgeni, log, readFilesProcessor, writeFilesProcessor) {
|
|
|
|
|
|
|
|
|
|
dgeni.stopOnValidationError = true;
|
|
|
|
|
dgeni.stopOnProcessingError = true;
|
|
|
|
|
|
|
|
|
|
log.level = 'info';
|
|
|
|
|
|
|
|
|
|
readFilesProcessor.basePath = path.resolve(__dirname,'../..');
|
|
|
|
|
readFilesProcessor.sourceFiles = [
|
2015-08-11 17:20:04 -07:00
|
|
|
{ include: 'src/**/*.js', exclude: 'src/angular.bind.js', basePath: 'src' },
|
2014-09-12 23:04:35 +01:00
|
|
|
{ include: 'docs/content/**/*.ngdoc', basePath: 'docs/content' }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
writeFilesProcessor.outputFolder = 'build/docs';
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(parseTagsProcessor) {
|
2016-11-16 14:14:48 +00:00
|
|
|
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/deprecated')); // this will override the jsdoc version
|
2014-09-12 23:04:35 +01:00
|
|
|
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/tutorial-step'));
|
|
|
|
|
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/sortOrder'));
|
2016-04-05 21:07:50 +01:00
|
|
|
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/installation'));
|
2016-08-06 18:24:14 +03:00
|
|
|
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/this'));
|
2016-11-16 14:14:48 +00:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(inlineTagProcessor, typeInlineTagDef) {
|
|
|
|
|
inlineTagProcessor.inlineTagDefinitions.push(typeInlineTagDef);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(templateFinder, renderDocsProcessor, gitData) {
|
2016-11-18 10:41:21 +00:00
|
|
|
// We are completely overwriting the folders
|
|
|
|
|
templateFinder.templateFolders.length = 0;
|
|
|
|
|
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/examples'));
|
|
|
|
|
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/ngdoc'));
|
|
|
|
|
templateFinder.templateFolders.unshift(path.resolve(packagePath, 'templates/app'));
|
2014-09-12 23:04:35 +01:00
|
|
|
renderDocsProcessor.extraData.git = gitData;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.config(function(computePathsProcessor, computeIdsProcessor) {
|
|
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
|
docTypes: ['error'],
|
|
|
|
|
pathTemplate: 'error/${namespace}/${name}',
|
|
|
|
|
outputPathTemplate: 'partials/error/${namespace}/${name}.html'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
|
docTypes: ['errorNamespace'],
|
|
|
|
|
pathTemplate: 'error/${name}',
|
|
|
|
|
outputPathTemplate: 'partials/error/${name}.html'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
|
docTypes: ['overview', 'tutorial'],
|
|
|
|
|
getPath: function(doc) {
|
|
|
|
|
var docPath = path.dirname(doc.fileInfo.relativePath);
|
2016-07-20 15:45:04 +02:00
|
|
|
if (doc.fileInfo.baseName !== 'index') {
|
2014-09-12 23:04:35 +01:00
|
|
|
docPath = path.join(docPath, doc.fileInfo.baseName);
|
|
|
|
|
}
|
|
|
|
|
return docPath;
|
|
|
|
|
},
|
2014-09-23 18:43:08 +01:00
|
|
|
outputPathTemplate: 'partials/${path}.html'
|
2014-09-12 23:04:35 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
|
docTypes: ['e2e-test'],
|
|
|
|
|
getPath: function() {},
|
|
|
|
|
outputPathTemplate: 'ptore2e/${example.id}/${deployment.name}_test.js'
|
|
|
|
|
});
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
computePathsProcessor.pathTemplates.push({
|
|
|
|
|
docTypes: ['indexPage'],
|
2014-10-06 16:55:42 +01:00
|
|
|
pathTemplate: '.',
|
2014-09-12 23:04:35 +01:00
|
|
|
outputPathTemplate: '${id}.html'
|
|
|
|
|
});
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-09-23 18:43:08 +01:00
|
|
|
computePathsProcessor.pathTemplates.push({
|
2016-07-20 15:45:04 +02:00
|
|
|
docTypes: ['module'],
|
2014-09-23 18:43:08 +01:00
|
|
|
pathTemplate: '${area}/${name}',
|
|
|
|
|
outputPathTemplate: 'partials/${area}/${name}.html'
|
|
|
|
|
});
|
|
|
|
|
computePathsProcessor.pathTemplates.push({
|
2016-07-20 15:45:04 +02:00
|
|
|
docTypes: ['componentGroup'],
|
2014-09-23 18:43:08 +01:00
|
|
|
pathTemplate: '${area}/${moduleName}/${groupType}',
|
|
|
|
|
outputPathTemplate: 'partials/${area}/${moduleName}/${groupType}.html'
|
|
|
|
|
});
|
2014-07-21 00:45:27 -07:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
computeIdsProcessor.idTemplates.push({
|
2017-08-20 15:44:01 +02:00
|
|
|
docTypes: ['overview', 'tutorial', 'e2e-test', 'indexPage'],
|
2014-09-12 23:04:35 +01:00
|
|
|
getId: function(doc) { return doc.fileInfo.baseName; },
|
|
|
|
|
getAliases: function(doc) { return [doc.id]; }
|
|
|
|
|
});
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
computeIdsProcessor.idTemplates.push({
|
2015-03-19 14:26:24 +00:00
|
|
|
docTypes: ['error'],
|
|
|
|
|
getId: function(doc) { return 'error:' + doc.namespace + ':' + doc.name; },
|
|
|
|
|
getAliases: function(doc) { return [doc.name, doc.namespace + ':' + doc.name, doc.id]; }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
docTypes: ['errorNamespace'],
|
2014-09-12 23:04:35 +01:00
|
|
|
getId: function(doc) { return 'error:' + doc.name; },
|
|
|
|
|
getAliases: function(doc) { return [doc.id]; }
|
2015-03-19 14:26:24 +00:00
|
|
|
}
|
|
|
|
|
);
|
2014-09-12 23:04:35 +01:00
|
|
|
})
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-10-06 16:55:42 +01:00
|
|
|
.config(function(checkAnchorLinksProcessor) {
|
|
|
|
|
checkAnchorLinksProcessor.base = '/';
|
2018-06-12 11:28:08 +03:00
|
|
|
checkAnchorLinksProcessor.errorOnUnmatchedLinks = true;
|
2014-10-06 16:55:42 +01:00
|
|
|
// We are only interested in docs that have an area (i.e. they are pages)
|
|
|
|
|
checkAnchorLinksProcessor.checkDoc = function(doc) { return doc.area; };
|
|
|
|
|
})
|
|
|
|
|
|
2014-05-02 14:45:37 +01:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
.config(function(
|
|
|
|
|
generateIndexPagesProcessor,
|
|
|
|
|
generateProtractorTestsProcessor,
|
|
|
|
|
generateExamplesProcessor,
|
|
|
|
|
debugDeployment, defaultDeployment,
|
2018-02-20 17:59:45 +01:00
|
|
|
jqueryDeployment, testDeployment,
|
|
|
|
|
productionDeployment) {
|
2014-03-07 11:18:55 +00:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
generateIndexPagesProcessor.deployments = [
|
|
|
|
|
debugDeployment,
|
|
|
|
|
defaultDeployment,
|
|
|
|
|
jqueryDeployment,
|
2018-02-20 17:59:45 +01:00
|
|
|
testDeployment,
|
2014-09-12 23:04:35 +01:00
|
|
|
productionDeployment
|
|
|
|
|
];
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
generateProtractorTestsProcessor.deployments = [
|
|
|
|
|
defaultDeployment,
|
|
|
|
|
jqueryDeployment
|
|
|
|
|
];
|
2014-02-12 22:47:42 +00:00
|
|
|
|
2014-10-19 10:28:03 +01:00
|
|
|
generateProtractorTestsProcessor.basePath = 'build/docs/';
|
|
|
|
|
|
2014-09-12 23:04:35 +01:00
|
|
|
generateExamplesProcessor.deployments = [
|
|
|
|
|
debugDeployment,
|
|
|
|
|
defaultDeployment,
|
|
|
|
|
jqueryDeployment,
|
2016-10-17 23:16:41 +02:00
|
|
|
productionDeployment
|
2014-09-12 23:04:35 +01:00
|
|
|
];
|
2016-01-13 13:57:59 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
.config(function(generateKeywordsProcessor) {
|
|
|
|
|
generateKeywordsProcessor.docTypesToIgnore = ['componentGroup'];
|
2014-09-12 23:04:35 +01:00
|
|
|
});
|