$(function(){
var converter = new showdown.Converter();
$.ajax('api/features').done(function(data){
var $table = $('table.features');
$.each(data, function(name, details) {
var requirements = $.map(details.requirements, function(r, name){
return '
' +
' | ' +
'' + name + ' | ' +
'' + converter.makeHtml(r.description) + ' | ' +
'' + (r.available ? 'YES' : 'NO') + ' | ' +
'
';
});
$table.append(
'' +
'' + name + ' | ' +
'' + converter.makeHtml(details.description) + ' | ' +
'' + (details.available ? 'YES' : 'NO') + ' | ' +
'
' +
requirements.join("")
);
})
});
});