aboutsummaryrefslogtreecommitdiffstats
path: root/docs/docs.config.js
blob: 883f80f0a1b692b1d42e95042c0b6eb4fe0ceafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
var path = require('canonical-path');
var versionInfo = require('../lib/versions/version-info');
var basePath = __dirname;

var basePackage = require('./config');

module.exports = function(config) {

  var cdnUrl = "//ajax.googleapis.com/ajax/libs/angularjs/" + versionInfo.currentPackage.cdnVersion;

  var getVersion = function(component, sourceFolder, packageFile) {
    sourceFolder = sourceFolder || '../bower_components';
    packageFile = packageFile || 'bower.json';
    return require(path.join(sourceFolder,component,packageFile)).version;
  };


  config = basePackage(config);

  config.set('source.projectPath', path.resolve(basePath, '..'));

  config.set('source.files', [
    { pattern: 'src/**/*.js', basePath: path.resolve(basePath,'..') },
    { pattern: '**/*.ngdoc', basePath: path.resolve(basePath, 'content') }
  ]);

  config.set('processing.stopOnError', true);

  config.set('processing.errors.minerrInfoPath', path.resolve(basePath, '../build/errors.json'));

  config.set('rendering.outputFolder', '../build/docs');
  config.set('rendering.contentsFolder', 'partials');

  config.set('logging.level', 'info');

  config.merge('deployment', {
    environments: [{
      name: 'debug',
      examples: {
        commonFiles: {
          scripts: [ '../../../angular.js' ]
        },
        dependencyPath: '../../..'
      },
      scripts: [
        '../angular.js',
        '../angular-resource.js',
        '../angular-route.js',
        '../angular-cookies.js',
        '../angular-sanitize.js',
        '../angular-touch.js',
        '../angular-animate.js',
        'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js',
        'js/angular-bootstrap/bootstrap.js',
        'js/angular-bootstrap/bootstrap-prettify.js',
        'js/angular-bootstrap/dropdown-toggle.js',
        'components/lunr.js-' + getVersion('lunr.js') + '/lunr.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
        'js/versions-data.js',
        'js/pages-data.js',
        'js/docs.js'
      ],
      stylesheets: [
        'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.css',
        'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
        'css/prettify-theme.css',
        'css/docs.css',
        'css/animations.css'
      ]
    },
    {
      name: 'default',
      examples: {
        commonFiles: {
          scripts: [ '../../../angular.min.js' ]
        },
        dependencyPath: '../../..'
      },
      scripts: [
        '../angular.min.js',
        '../angular-resource.min.js',
        '../angular-route.min.js',
        '../angular-cookies.min.js',
        '../angular-sanitize.min.js',
        '../angular-touch.min.js',
        '../angular-animate.min.js',
        'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js',
        'js/angular-bootstrap/bootstrap.js',
        'js/angular-bootstrap/bootstrap-prettify.js',
        'js/angular-bootstrap/dropdown-toggle.js',
        'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
        'js/versions-data.js',
        'js/pages-data.js',
        'js/docs.js'
      ],
      stylesheets: [
        'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.min.css',
        'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
        'css/prettify-theme.css',
        'css/docs.css',
        'css/animations.css'
      ]
    },
    {
      name: 'jquery',
      examples: {
        commonFiles: {
          scripts: [
            '../../components/jquery-' + getVersion('jquery') + '/jquery.js',
            '../../../angular.js'
          ]
        },
        dependencyPath: '../../..'
      },
      scripts: [
        'components/jquery-' + getVersion('jquery') + '/jquery.js',
        '../angular.min.js',
        '../angular-resource.min.js',
        '../angular-route.min.js',
        '../angular-cookies.min.js',
        '../angular-sanitize.min.js',
        '../angular-touch.min.js',
        '../angular-animate.min.js',
        'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js',
        'js/angular-bootstrap/bootstrap.js',
        'js/angular-bootstrap/bootstrap-prettify.js',
        'js/angular-bootstrap/dropdown-toggle.js',
        'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
        'js/versions-data.js',
        'js/pages-data.js',
        'js/docs.js'
      ],
      stylesheets: [
        'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.min.css',
        'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
        'css/prettify-theme.css',
        'css/docs.css',
        'css/animations.css'
      ]
    },
    {
      name: 'production',
      examples: {
        commonFiles: {
          scripts: [ cdnUrl + '/angular.min.js' ]
        },
        dependencyPath: cdnUrl
      },
      scripts: [
        cdnUrl + '/angular.min.js',
        cdnUrl + '/angular-resource.min.js',
        cdnUrl + '/angular-route.min.js',
        cdnUrl + '/angular-cookies.min.js',
        cdnUrl + '/angular-sanitize.min.js',
        cdnUrl + '/angular-touch.min.js',
        cdnUrl + '/angular-animate.min.js',
        'components/marked-' + getVersion('marked', '../node_modules', 'package.json') + '/lib/marked.js',
        'js/angular-bootstrap/bootstrap.js',
        'js/angular-bootstrap/bootstrap-prettify.js',
        'js/angular-bootstrap/dropdown-toggle.js',
        'components/lunr.js-' + getVersion('lunr.js') + '/lunr.min.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js',
        'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
        'js/versions-data.js',
        'js/pages-data.js',
        'js/docs.js'
      ],
      stylesheets: [
        'components/bootstrap-' + getVersion('bootstrap') + '/dist/css/bootstrap.min.css',
        'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css',
        'css/prettify-theme.css',
        'css/docs.css',
        'css/animations.css'
      ]
    }
  ]
  });

  return config;
};