From b9feb35753d57638d453926cc437dd045ce79d9a Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 25 Jan 2016 10:17:00 -0500 Subject: [PATCH] making it work for one file --- tasks/index.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tasks/index.js b/tasks/index.js index f4eed3b..2f5ec0e 100644 --- a/tasks/index.js +++ b/tasks/index.js @@ -2,13 +2,11 @@ module.exports = function(grunt) { grunt.registerMultiTask('cml', 'Grunt task for converting CML to HTML', function() { var cml_html_converter = require('cml-html-converter'); - var result = cml_html_converter('line1\n\tline2'); - console.log(result); -/* + // Merge task-specific and/or target-specific options with these defaults. var options = this.options({ - punctuation: '.', - separator: ', ' + punctuation: '', + separator: '' }); // Iterate over all specified file groups. @@ -19,12 +17,12 @@ module.exports = function(grunt) { if (!grunt.file.exists(filepath)) { grunt.log.warn('Source file "' + filepath + '" not found.'); return false; - } else { + } else { return true; } }).map(function(filepath) { // Read file source. - return grunt.file.read(filepath); + return cml_html_converter(grunt.file.read(filepath)); }).join(grunt.util.normalizelf(options.separator)); // Handle options. @@ -36,7 +34,7 @@ module.exports = function(grunt) { // Print a success message. grunt.log.writeln('File "' + f.dest + '" created.'); }); -*/ + }); };