2015-06-30 11:33:16 +02:00
//compile.js
var fs = require ( 'fs' ) ;
var marked = require ( 'marked' ) ;
2015-08-24 12:29:06 +02:00
var buffer = '<a href="http://hoewerkt.werkmanrooster.nl">Een betere leeservaring is op http://hoewerkt.werkmanrooster.nl, het is ook bedoelt om het hier te lezen. Ook staat dit papier NIET op de bedoelde volgorde.</a>' ;
2015-06-30 11:33:16 +02:00
2015-11-05 10:45:20 +01:00
var folders = fs . readdirSync ( _ _dirname + '/articles' ) ;
2015-06-30 11:33:16 +02:00
2015-11-05 10:45:20 +01:00
for ( var folder of folders ) {
if ( folder != 'index.md' ) {
var articles = fs . readdirSync ( _ _dirname + '/articles/' + folder ) ;
for ( var article of articles ) {
buffer += marked ( fs . readFileSync ( _ _dirname + '/articles/' + folder + '/' + article ) . toString ( ) ) ;
}
}
else {
buffer += marked ( fs . readFileSync ( _ _dirname + '/articles/' + folder ) . toString ( ) ) ;
}
2015-06-30 11:33:16 +02:00
}
fs . writeFileSync ( _ _dirname + '/pws.html' , buffer ) ;