diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58db40d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +docs/index.html +node_modules/ diff --git a/build.js b/build.js new file mode 100644 index 0000000..af4746f --- /dev/null +++ b/build.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node +const ejs = require("ejs"); +const fs = require("fs"); + +let id = 0; +function getNewId() { + return ++id; +} +function getCurrentId() { + return id; +} + +function buildDocs() { + const template = fs.readFileSync("./docs/index.html.ejs", "utf-8"); + + fs.writeFileSync( + "./docs/index.html", + ejs.render(template, { getNewId, getCurrentId }) + ); +} + +buildDocs(); diff --git a/docs/index.html b/docs/index.html.ejs similarity index 94% rename from docs/index.html rename to docs/index.html.ejs index f01b26c..0fc0bb3 100644 --- a/docs/index.html +++ b/docs/index.html.ejs @@ -166,8 +166,8 @@