spec - Cleanup body to only keep "spec-container"

This commit is contained in:
2026-03-27 19:43:07 +05:30
parent ed4360e7cd
commit 795a713a86
40 changed files with 134 additions and 780 deletions
+17
View File
@@ -0,0 +1,17 @@
const fs = require("fs");
const path = require("path");
const cheerio = require("cheerio");
const dir = path.join(__dirname, "spec-built/multipage");
fs.readdirSync(dir).forEach((file) => {
if (!file.endsWith(".html")) return;
const filePath = path.join(dir, file);
const content = fs.readFileSync(filePath, "utf-8");
const $ = cheerio.load(content);
const container = $("#spec-container");
if (container.length) {
$("body").empty().append(container);
fs.writeFileSync(filePath, $.html());
console.log(`Processed ${file}`);
}
});