File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ module.exports = function(config) {
99 config = angularjsPackage ( config ) ;
1010
1111 config . append ( 'processing.processors' , [
12+ require ( './processors/git-data' ) ,
1213 require ( './processors/keywords' ) ,
1314 require ( './processors/versions-data' ) ,
1415 require ( './processors/pages-data' ) ,
Original file line number Diff line number Diff line change 1+ var gruntUtils = require ( '../../../lib/grunt/utils' ) ;
2+
3+ module . exports = {
4+ name : 'git-data' ,
5+ runBefore : [ 'loading-files' ] ,
6+ description : 'This processor adds information from the local git repository to the extraData injectable' ,
7+ init : function ( config , injectables ) {
8+ injectables . value ( 'gitData' , {
9+ version : gruntUtils . getVersion ( ) ,
10+ versions : gruntUtils . getPreviousVersions ( ) ,
11+ info : gruntUtils . getGitRepoInfo ( )
12+ } ) ;
13+ } ,
14+ process : function ( extraData , gitData ) {
15+ extraData . git = gitData ;
16+ }
17+ } ;
Original file line number Diff line number Diff line change 11var _ = require ( 'lodash' ) ;
22
3- var version ;
4- var versions ;
5-
63module . exports = {
74 name : 'versions-data' ,
85 description : 'This plugin will create a new doc that will be rendered as an angularjs module ' +
96 'which will contain meta information about the versions of angular' ,
107 runAfter : [ 'adding-extra-docs' , 'pages-data' ] ,
118 runBefore : [ 'extra-docs-added' ] ,
12- init : function ( config ) {
13- version = config . source . currentVersion ;
14- versions = config . source . previousVersions ;
9+ process : function ( docs , gitData ) {
10+
11+ var version = gitData . version ;
12+ var versions = gitData . versions ;
1513
1614 if ( ! version ) {
1715 throw new Error ( 'Invalid configuration. Please provide a valid `source.currentVersion` property' ) ;
1816 }
1917 if ( ! versions ) {
2018 throw new Error ( 'Invalid configuration. Please provide a valid `source.previousVersions` property' ) ;
2119 }
22- } ,
23- process : function ( docs ) {
2420
2521 var versionDoc = {
2622 docType : 'versions-data' ,
Original file line number Diff line number Diff line change 11var path = require ( 'canonical-path' ) ;
2- var gruntUtils = require ( '../lib/grunt/utils' ) ;
32var basePath = __dirname ;
43
54var basePackage = require ( './config' ) ;
@@ -13,21 +12,11 @@ module.exports = function(config) {
1312 { pattern : '**/*.ngdoc' , basePath : path . resolve ( basePath , 'content' ) }
1413 ] ) ;
1514
16- var version = gruntUtils . getVersion ( ) ;
17- var versions = gruntUtils . getPreviousVersions ( ) ;
18- config . set ( 'source.currentVersion' , version ) ;
19- config . set ( 'source.previousVersions' , versions ) ;
20-
2115 config . set ( 'processing.examples.commonFiles' , {
2216 scripts : [ '../../../angular.js' ] ,
2317 stylesheets : [ ]
2418 } ) ;
2519
26- config . merge ( 'rendering.extra' , {
27- git : gruntUtils . getGitRepoInfo ( ) ,
28- version : version
29- } ) ;
30-
3120 config . set ( 'rendering.outputFolder' , '../build/docs' ) ;
3221
3322 config . set ( 'logging.level' , 'debug' ) ;
You can’t perform that action at this time.
0 commit comments