diff --git a/make_repl_index_html_hb.js b/make_repl_index_html_hb.js new file mode 100644 index 00000000..6187bd7b --- /dev/null +++ b/make_repl_index_html_hb.js @@ -0,0 +1,27 @@ +var fs = require('fs') + +var get_ramda_file = require('./get_ramda_file') + +var handlebars = require('handlebars') + +var marked = require('marked') + +var devDependencies = require('./package.json').devDependencies +var version = devDependencies.ramda +var repl_tag = devDependencies['ramda-repl'] + +get_ramda_file('README.md') +.catch((err) => console.error(err)) +.then((readme_md) => { + var readme_html = marked(readme_md) + + var template = fs.readFileSync('repl/index.html.handlebars', {encoding: 'utf8'}) + + var html = handlebars.compile(template)({ + version: version, + repl_tag: repl_tag + }) + + fs.writeFileSync('repl/index.html', html, {encoding: 'utf8'}) + console.log('Generated repl/index.html'); +}) diff --git a/package.json b/package.json index e9beff2e..82351f9a 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "marked": "0.3.x", "pug": "^2.0.0-beta6", "ramda": "0.24.1", + "ramda-repl": "1.1.0", "semver-compare": "1.0.x", "walk": "2.3.x" }, diff --git a/repl/index.html b/repl/index.html index 7148d568..a00c14bb 100644 --- a/repl/index.html +++ b/repl/index.html @@ -16,7 +16,7 @@ - + + - + + diff --git a/repl/index.html.handlebars b/repl/index.html.handlebars index a911e4a8..c09fe145 100644 --- a/repl/index.html.handlebars +++ b/repl/index.html.handlebars @@ -16,7 +16,7 @@ - +