|
3 | 3 | module.exports = function(grunt) {
|
4 | 4 |
|
5 | 5 | var marked = require('marked');
|
6 |
| - // var hl = require('highlight').Highlight; |
7 | 6 | var hl = require('node-syntaxhighlighter');
|
| 7 | + |
8 | 8 | marked.setOptions({
|
9 | 9 | highlight: function(code, lang) {
|
10 | 10 | lang = lang || 'javascript';
|
@@ -39,7 +39,17 @@ module.exports = function(grunt) {
|
39 | 39 | },
|
40 | 40 | options: {
|
41 | 41 | stripBanners: true,
|
42 |
| - banner: '<%= meta.banner %>' |
| 42 | + banner: '<%= meta.banner %>', |
| 43 | + process: function(src) { |
| 44 | + var umdHead = grunt.file.read('lib/tmpl/umdhead.tpl'), |
| 45 | + umdFoot = grunt.file.read('lib/tmpl/umdfoot.tpl'); |
| 46 | + |
| 47 | + src = src |
| 48 | + .replace('(function($) {', umdHead) |
| 49 | + .replace('})(jQuery);', umdFoot); |
| 50 | + |
| 51 | + return src; |
| 52 | + } |
43 | 53 | }
|
44 | 54 | },
|
45 | 55 | uglify: {
|
@@ -110,32 +120,6 @@ module.exports = function(grunt) {
|
110 | 120 | }
|
111 | 121 | });
|
112 | 122 |
|
113 |
| - grunt.registerMultiTask( 'setshell', 'Set grunt shell commands', function() { |
114 |
| - var settings, cmd, |
115 |
| - tgt = this.target, |
116 |
| - cmdLabel = 'shell.' + tgt + '.command', |
117 |
| - file = this.data.file, |
118 |
| - append = this.data.cmdAppend || ''; |
119 |
| - |
120 |
| - if ( !grunt.file.exists(file) ) { |
121 |
| - grunt.warn('File does not exist: ' + file); |
122 |
| - } |
123 |
| - |
124 |
| - settings = grunt.file.readJSON(file); |
125 |
| - if (!settings[tgt]) { |
126 |
| - grunt.warn('No ' + tgt + ' property found in ' + file); |
127 |
| - } |
128 |
| - |
129 |
| - cmd = settings[tgt] + append; |
130 |
| - grunt.config(cmdLabel, cmd); |
131 |
| - grunt.log.writeln( ('Setting ' + cmdLabel + ' to:').cyan ); |
132 |
| - |
133 |
| - grunt.log.writeln(cmd); |
134 |
| - |
135 |
| - }); |
136 |
| - |
137 |
| - grunt.registerTask( 'deploy', ['setshell:rsync', 'shell:rsync']); |
138 |
| - |
139 | 123 | grunt.registerTask( 'configs', 'Update json configs based on package.json', function() {
|
140 | 124 | var pkg = grunt.file.readJSON('package.json'),
|
141 | 125 | pkgBasename = grunt.config('pluginName'),
|
@@ -182,5 +166,4 @@ module.exports = function(grunt) {
|
182 | 166 | grunt.loadNpmTasks('grunt-contrib-concat');
|
183 | 167 | grunt.loadNpmTasks('grunt-contrib-watch');
|
184 | 168 | grunt.loadNpmTasks('grunt-version');
|
185 |
| - grunt.loadNpmTasks('grunt-shell'); |
186 | 169 | };
|
0 commit comments