Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing build for windows (swap backslash for forward slash in path) #551

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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