#!/usr/bin/env node

'use strict';

var stdin = process.openStdin();

var Handlebars = require('handlebars');

main();

function main() {
    stdin.setEncoding('utf8');
    stdin.on('data', function(data) {
        generateList(JSON.parse(data));
    });
}

function generateList(data) {
    var source = '{{#items}}* [{{{title}}}]({{url}})\n{{/items}}';
    var template = Handlebars.compile(source);

    console.log(template({
        items: data
    }));
}

@@ -333,16 +333,60 @@
 %7B%7Burl%7D%7D)
+%7B%7B#if description%7D%7D - %7B%7Bdescription%7D%7D%7B%7B/if%7D%7D
 %5Cn%7B%7B/ite

Support `description` field