1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-12-15 05:43:45 +01:00

🎉 docs/p05-scopes

This commit is contained in:
2023-11-30 17:05:19 +01:00
parent 01f102c149
commit fb14d51cb4
13 changed files with 240 additions and 16 deletions

View File

@@ -10,16 +10,19 @@ const pkg= s.cat("package.json").xargs(JSON.parse);
for(const info of pages){
const { id }= info;
echo(`Generating ${id}.html…`);
const ssr= createHTMl("");
const { el }= await register(ssr.dom);
const serverDOM= createHTMl("");
serverDOM.registerGlobally(
"HTMLScriptElement"
);
const { el }= await register(serverDOM.dom);
const { page }= await import(`../docs_src/${id}.html.js`); //→ TODO: important to mention in docs!!!
document.body.append(
serverDOM.document.body.append(
el(page, { pkg, info }),
);
echo.use("-R", `Writing ${id}.html…`);
dispatchEvent("oneachrender", document);
s.echo(ssr.serialize()).to(path_target.root+id+".html");
s.echo(serverDOM.serialize()).to(path_target.root+id+".html");
}
s.echo(styles.content).to(path_target.css+styles.name);
dispatchEvent("onssrend");