index.js
function lintMarkdown (body, file) {
  var codeBlocks = parseMarkdown(body);

  didLogFileBreak = false;

  var failedCodeBlocks = _.reject(_.compact(codeBlocks), function (codeBlock) {
    return validateCodeBlock(codeBlock, file);
  });

  numFilesToParse--;

  if (failedCodeBlocks.length === 0) {
    if (program.verbose) {
      console.log('Markdown passed linting for '.green + file.blue.bold + '\n');
    } else if (numFilesToParse === 0) {
      console.log('All markdown files passed linting'.green);
    }
  } else {
    if (numFailedFiles % 2 === 0) {
    console.log('Markdown failed linting for '.red + file.yellow);
    } else {
      console.log('Markdown failed linting for '.red + file.blue);
    }
    numFailedFiles++;
    console.log('');
  }
}
function lintMarkdown (body, file) {
  var codeBlocks = parseMarkdown(body);

  didLogFileBreak = false;

  var failedCodeBlocks = _.reject(_.compact(codeBlocks), function (codeBlock) {
    return validateCodeBlock(codeBlock, file);
  });

  numFilesToParse--;

  if (failedCodeBlocks.length === 0) {
    if (program.verbose) {
      console.log('Markdown passed linting for '.green + file.blue.bold + '\n');
    } else if (numFilesToParse === 0) {
      console.log('All markdown files passed linting'.green);
    }
  } else {
    if (numFailedFiles % 2 === 0) {
    console.log('Markdown failed linting for '.red + file.yellow);
    } else {
      console.log('Markdown failed linting for '.red + file.blue);
    }
    numFailedFiles++;
    console.log('');
  }
}
function lintMarkdown ( body , file ) { var codeBlocks = parseMarkdown ( body ) ; didLogFileBreak = false ; var failedCodeBlocks = _ . reject ( _ . compact ( codeBlocks ) , function ( codeBlock ) { return validateCodeBlock ( codeBlock , file ) ; } ) ; numFilesToParse -- ; if ( failedCodeBlocks . length === 0 ) { if ( program . verbose ) { console . log ( 'Markdown passed linting for ' . green + file . blue . bold + '\n' ) ; } else if ( numFilesToParse === 0 ) { console . log ( 'All markdown files passed linting' . green ) ; } } else { if ( numFailedFiles % 2 === 0 ) { console . log ( 'Markdown failed linting for ' . red + file . yellow ) ; } else { console . log ( 'Markdown failed linting for ' . red + file . blue ) ; } numFailedFiles ++ ; console . log ( '' ) ; } }
Parses the JavaScript code blocks from the markdown file
@param  {String} body Body of markdown file
@param  {String} file Filename
Parses the JavaScript code blocks from the markdown file