config.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var Package = require('dgeni').Package;
  2. var path = require('canonical-path');
  3. var _ = require('lodash');
  4. var projectPath = path.resolve(__dirname, '../');
  5. var packagePath = __dirname;
  6. module.exports = new Package('ng-table', [
  7. require('dgeni-packages/ngdoc'),
  8. require('dgeni-packages/nunjucks')
  9. ])
  10. .processor(require('./processors/indexPage'))
  11. .processor(require('./processors/componentsData'))
  12. .config(function (log, templateEngine, templateFinder) {
  13. templateEngine.config.tags = {
  14. variableStart: '{$',
  15. variableEnd: '$}'
  16. };
  17. templateFinder.templateFolders = [
  18. path.resolve(packagePath, 'template'),
  19. path.resolve(packagePath, 'template/ngdoc')
  20. ]
  21. })
  22. .config(function(readFilesProcessor, writeFilesProcessor){
  23. readFilesProcessor.basePath = projectPath;
  24. readFilesProcessor.sourceFiles = [
  25. { include:'dist/ng-table.js', basePath:'dist' }
  26. ];
  27. writeFilesProcessor.outputFolder = 'dist/docs'
  28. })
  29. .config(function(computeIdsProcessor, computePathsProcessor){
  30. computeIdsProcessor.idTemplates.push({
  31. docTypes: ['parameters'],
  32. idTemplate: 'parameters-${fileInfo.relativePath.replace("/","-")}',
  33. getAliases: function(doc) { return [doc.id]; }
  34. });
  35. computePathsProcessor.pathTemplates.push({
  36. docTypes: ['parameters'],
  37. getPath: function(doc) {
  38. var docPath = path.dirname(doc.fileInfo.relativePath);
  39. if ( doc.fileInfo.baseName !== 'index' ) {
  40. docPath = path.join(docPath, doc.fileInfo.baseName);
  41. }
  42. return docPath;
  43. },
  44. getOutputPath: function(doc) {
  45. return path.join(
  46. 'partials',
  47. path.dirname(doc.fileInfo.relativePath),
  48. doc.fileInfo.baseName) + '.html';
  49. }
  50. });
  51. })
  52. .config(function(generateComponentGroupsProcessor){
  53. generateComponentGroupsProcessor.$enabled = false;
  54. });