Skip to content

Instantly share code, notes, and snippets.

@doowb
Created June 11, 2013 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save doowb/5761378 to your computer and use it in GitHub Desktop.
Save doowb/5761378 to your computer and use it in GitHub Desktop.
var helperList = ['a', 'b', 'c', 'd', 'e'];
var documentedList = ['a', 'c'];
var undocumentedList = [];
helperList.forEach(function(helper) {
if(_.contains(documentedList, helper) === false) {
undocumentedList.push(helper);
}
});
console.log(undocumentedList);
@jonschlinkert
Copy link

[Heading One](#Heading One)

@jonschlinkert
Copy link

/regex/, [$1]($1)

@jonschlinkert
Copy link

module.exports.toc = toc = function(src) {
  var content;

  content = grunt.file.expand(src)
  .map(grunt.file.read).join('')
  .match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/gm).join('')
  .replace(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/gm, '$1 [$2](#' + '$2' + ')\n');
  return Utils.safeString(content);
};

@jonschlinkert
Copy link

One
Two
Three
Four
Five
Six

@jonschlinkert
Copy link

[Heading One](#heading-one)

@doowb
Copy link
Author

doowb commented Jun 11, 2013

var list = ['Heading One', 'Heading Two', 'Heading Three', 'Heading Four', 'Heading Five', 'Heading Six'];

var content = '';
list.forEach(function(heading) {
  content += '[' + heading + '](#' + _.dashify(heading.toLowercase()) + ')\n';
});

@jonschlinkert
Copy link

module.exports = {
   # jsFiddle: Embed a jsFiddle, second parameter sets tabs
  # Usage: {{ jsfiddle [id] [tabs] }}
  jsfiddle: jsfiddle = (id, tabs) ->
    tabs   = "result,js,html,css"  if Utils.isUndefined(tabs)
    result = '<iframe width="100%" height="300" src="http://jsfiddle.net/' + id + '/embedded/' + tabs + '/presentation/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>'
    Utils.safeString(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment