1
0
mirror of https://github.com/jdan/98.css.git synced 2026-05-05 06:01:22 +09:00

substantive changes

This commit is contained in:
Chris Kanich
2020-04-22 11:40:10 -05:00
committed by Jordan Scales
parent e8d87ed52f
commit 84d2756c9c
9 changed files with 89 additions and 6 deletions

View File

@@ -5,6 +5,8 @@ const fs = require("fs");
const hljs = require("highlight.js");
const mkdirp = require("mkdirp");
const postcss = require("postcss");
const glob = require("glob");
const path = require("path");
let id = 0;
function getNewId() {
@@ -33,7 +35,13 @@ function example(code) {
function buildDocs() {
const template = fs.readFileSync("docs/index.html.ejs", "utf-8");
fs.copyFileSync("build/98.css", "docs/98.css");
glob("build/*", function (er, files) {
if (!er) {
files.forEach((srcfile) =>
fs.copyFileSync(srcfile, path.join("docs", path.basename(srcfile)))
);
} else throw "error globbing build directory.";
});
fs.writeFileSync(
"docs/index.html",
ejs.render(template, { getNewId, getCurrentId, example })
@@ -45,6 +53,7 @@ function buildCSS() {
.use(require("postcss-inline-svg"))
.use(require("postcss-css-variables")({ preserve: "computed" }))
.use(require("postcss-calc"))
.use(require("postcss-copy")({ dest: "build" }))
.process(fs.readFileSync("style.css"), {
from: "style.css",
to: "build/98.css",