Skip to content

Commit 13f09a7

Browse files
authored
update (#102)
1 parent 5fbf5ef commit 13f09a7

File tree

10 files changed

+3114
-324
lines changed

10 files changed

+3114
-324
lines changed

.github/build.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Convert to markdown
2+
// use layout to
3+
// create index.html
4+
// create guide.html

build.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const path = require("path");
2+
const fs = require("fs");
3+
const showdown = require("showdown");
4+
const pupa = require("pupa");
5+
6+
function readFile(filename) {
7+
return fs.readFileSync(path.join(__dirname, "templates", filename), "utf-8");
8+
}
9+
10+
function render(filename, content) {
11+
fs.writeFileSync(
12+
path.join(__dirname, "public", filename),
13+
pupa(layout, { content })
14+
);
15+
}
16+
17+
const layout = readFile("layout.html");
18+
const index = readFile("index.html");
19+
20+
const converter = new showdown.Converter({ simplifiedAutoLink: true });
21+
const guideMarkdown = readFile("GUIDE.md");
22+
// const headingRegexp = /^## (.*)$/gm;
23+
// console.log("res", text.match(headingRegexp));
24+
const guide = converter.makeHtml(guideMarkdown);
25+
26+
render("index.html", index);
27+
render("guide.html", guide);

0 commit comments

Comments
 (0)