module.exports = function (grunt) { return function (list, opts) { var files = list.sort().map(function (entry) { var f = entry.replace(/.*\//, ''); return [f.replace('.html', '').replace(/-/g, ' '), f]; }).filter(function (e) { return e[0] !== 'index'; }); var rows = []; for (var i = 0; i < files.length; i += 5) { var cols = []; for (var j = 0; j < 5; ++j) { if (i + j >= files.length) { break; } var file = files[i + j]; cols.push(' ' + file[0] + ''); } rows.push(' \n' + cols.join('\n') + '\n'); } var body = '\n' + rows.join('\n') + '\n
'; return [ '' + opts.title + '', '', '
', '

' + opts.heading + '

', '

' + opts.description + '

', '

Contributions ' + 'welcome.', 'Source ', 'here.

', body, '
' ].join('\n'); }; };