Skip to content

Commit

Permalink
fixing build for windows (swap backslash for forward slash in path) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjofrank authored Jul 8, 2024
1 parent de277c0 commit 417da23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 12 additions & 9 deletions reference.page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ export default function* () {
"",
);

const trailingLength = file.path.endsWith("index.html")
? -"index.html".length
: -".html".length;

let path = file.path.slice("reference_gen/gen".length, trailingLength);

// replace slashes for windows
path = path.replace(/\\/g, "/");

yield {
url: "/api" +
file.path.slice(
"reference_gen/gen".length,
file.path.endsWith("index.html")
? -"index.html".length
: -".html".length,
),
url: "/api" + path,
title: file.name.slice(0, -".html".length),
content,
};
}
} catch {
console.warn("⚠️ Reference docs were not generated.");
} catch (ex) {
console.warn("⚠️ Reference docs were not generated." + ex);
}
}
1 change: 0 additions & 1 deletion reference_gen/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"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=. --allow-env --allow-sys node-docs.ts",
"types": "deno task types:deno && deno task types:node",

"doc:deno": "mkdir -p gen/deno && DENO_INTERNAL_HTML_DOCS=deno deno doc --html --name=Deno --category-docs=deno-categories.json --output=gen/deno --strip-trailing-html types/deno.d.ts",
"doc:web": "mkdir -p gen/web && DENO_INTERNAL_HTML_DOCS=deno deno doc --html --name=Web --category-docs=web-categories.json --output=gen/web --strip-trailing-html types/web.d.ts",
"doc:node": "mkdir -p gen/node && DENO_INTERNAL_HTML_DOCS=node deno doc --html --name=Node --output=gen/node --symbol-redirect-map=node-symbol-map.json --default-symbol-map=node-default-map.json --strip-trailing-html types/node/[!_]*",
Expand Down

0 comments on commit 417da23

Please sign in to comment.