Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Jun 20, 2024
1 parent 48300e2 commit e002f3d
Show file tree
Hide file tree
Showing 12 changed files with 5,542 additions and 94 deletions.
115 changes: 115 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const config = {
{
href: "https://www.deno.com",
label: "deno.com",
position: "left",
position: "right",
activeBaseRegex: `^/api`,
},
],
Expand Down
15 changes: 14 additions & 1 deletion reference/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { pooledMap } from "@std/async/pool";
import { DOMParser } from "@b-fuze/deno-dom";

const nav = await Deno.readTextFile("nav.html");
const navDeno = await Deno.readTextFile("nav_deno.html");
const navWeb = await Deno.readTextFile("nav_web.html");
const navNode = await Deno.readTextFile("nav_node.html");

const navHead = `
<link rel="stylesheet" href="/docusaurus.css">
Expand All @@ -25,8 +28,18 @@ const res = pooledMap(
if (extname(entry.path) === ".html") {
const file = await Deno.readTextFile(entry.path);
const document = new DOMParser().parseFromString(file, "text/html");

let subNav = "";
if (entry.path.startsWith("gen/deno")) {
subNav = navDeno;
} else if (entry.path.startsWith("gen/web")) {
subNav = navWeb;
} else if (entry.path.startsWith("gen/node")) {
subNav = navNode;
}

document.head.innerHTML = document.head.innerHTML + navHead;
document.body.innerHTML = nav + document.body.innerHTML;
document.body.innerHTML = nav + subNav + document.body.innerHTML;

await Deno.writeTextFile(outPath, "<!DOCTYPE html>" + document.documentElement!.outerHTML, {
create: true,
Expand Down
2 changes: 2 additions & 0 deletions reference/deno-docs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Project, ts } from "ts-morph";
import $ from "dax";

await Deno.mkdir("types", { recursive: true });

const tempFile = await Deno.makeTempFile();

await $`deno types`.stdout($.path(tempFile));
Expand Down
6 changes: 3 additions & 3 deletions reference/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"@types/node": "npm:@types/[email protected]",
"browserslist": "npm:[email protected]",
"dax": "jsr:@david/dax@^0.40.1",
"lightningcss": "npm:lightningcss",
"lightningcss": "npm:lightningcss@1.15",
"ts-morph": "npm:[email protected]"
},
"tasks": {
"types:deno": "deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts",
"types:node": "deno run --allow-read --allow-write=types/node --allow-env --allow-sys node-docs.ts",
"types:node": "deno run --allow-read --allow-write=. --allow-env --allow-sys node-docs.ts",
"types": "deno task types:deno && deno task types:node",
"doc:deno": "DENO_INTERNAL_HTML_DOCS=deno deno doc --html --name=Deno --output=gen/deno types/deno.d.ts",
"doc:web": "DENO_INTERNAL_HTML_DOCS=deno deno doc --html --name=Web --output=gen/web types/web.d.ts",
"doc:node": "DENO_INTERNAL_HTML_DOCS=node deno doc --html --name=Node --output=gen/node types/node/[!_]*",
"doc": "deno task doc:deno && deno task doc:web && deno task types:node",
"doc": "deno task doc:deno && deno task doc:web && deno task doc:node",

"serve": "deno run --allow-read=. --allow-net --watch serve.ts",
"build": "deno run --allow-read=. --allow-write=. --allow-env build.ts"
Expand Down
62 changes: 29 additions & 33 deletions reference/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5,192 changes: 5,191 additions & 1 deletion reference/docusaurus.css

Large diffs are not rendered by default.

Loading

0 comments on commit e002f3d

Please sign in to comment.