mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 23:44:56 +03:00
18 lines
441 B
JavaScript
18 lines
441 B
JavaScript
|
#!/usr/bin/env node
|
||
|
|
||
|
var fs = require('fs');
|
||
|
var util = require('util');
|
||
|
|
||
|
fs.readFile('spec.txt', 'utf8', function(err, data) {
|
||
|
if (err) {
|
||
|
return console.log(err);
|
||
|
}
|
||
|
var examples = [];
|
||
|
data.replace(/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$/gm,
|
||
|
function(_,x,y){
|
||
|
examples.push({markdown: x, html: y});
|
||
|
});
|
||
|
console.log(util.inspect(examples, { depth: null }));
|
||
|
console.warn(examples.length + ' examples');
|
||
|
});
|