+
{props.children}
-
+ {reference &&
}
+ {!reference &&
}
>
);
diff --git a/deno.json b/deno.json
index 92da6713..dd1f5d4d 100644
--- a/deno.json
+++ b/deno.json
@@ -13,8 +13,10 @@
"tailwindcss": "npm:tailwindcss@^3.4.9"
},
"tasks": {
- "build": "deno run -A lume.ts",
"serve": "deno run -A lume.ts -s",
+ "start": "deno task serve",
+ "dev": "deno task serve",
+ "build": "deno run -A lume.ts",
"debug": "deno task build && deno task prod",
"prod": "cd _site && deno run --allow-read --allow-env --allow-net server.ts",
"reference": "cd reference_gen && deno task types && deno task doc",
diff --git a/examples/index.tsx b/examples/index.tsx
index 3522a95d..8ce3e811 100644
--- a/examples/index.tsx
+++ b/examples/index.tsx
@@ -1,30 +1,5 @@
export const layout = "raw.tsx";
-export const sidebar = [
- {
- items: [
- {
- label: "Runtime",
- id: "/runtime/",
- },
- {
- label: "API Reference",
- id: "/api/deno/",
- },
- {
- label: "Examples",
- id: "/examples/",
- },
- {
- label: "Deploy",
- id: "/deploy/",
- },
- {
- label: "Subhosting",
- id: "/subhosting/",
- },
- ],
- },
-];
+export const sidebar = [];
export const toc = [];
diff --git a/index.page.tsx b/index.page.tsx
index a9f7f965..2cc442df 100644
--- a/index.page.tsx
+++ b/index.page.tsx
@@ -4,26 +4,6 @@ export const url = "/";
export const sidebar = [
{
items: [
- {
- label: "Runtime Manual",
- id: "/runtime/",
- },
- {
- label: "API reference",
- id: "/api/deno",
- },
- {
- label: "Examples",
- id: "/examples/",
- },
- {
- label: "Deploy",
- id: "/deploy/manual/",
- },
- {
- label: "Subhosting",
- id: "/subhosting/manual/",
- },
{
label: "deno.com",
id: "https://deno.com",
diff --git a/overrides.css b/overrides.css
index 3b3d539f..9ffb99cf 100644
--- a/overrides.css
+++ b/overrides.css
@@ -1,4 +1,4 @@
-/* This file exists to provide CSS overrides to styles that exist on the pages
+/* This file exists to provide CSS overrides to styles that exist on the pages
that are generated by deno_doc, the tool that powers the API reference documentation */
#content > main > section + div {
@@ -63,8 +63,8 @@ that are generated by deno_doc, the tool that powers the API reference documenta
@apply ml-1 !important;
}
-.doc .toc :not(.documentNavigation) > a {
- @apply text-xl !important;
+.ddoc .z-50 {
+ z-index: 49 !important;
}
.ddoc .usageContent {
@@ -115,3 +115,33 @@ that are generated by deno_doc, the tool that powers the API reference documenta
.ddoc .space-y-7 > .section .markdown-body {
@apply mb-6 !important;
}
+
+.totop {
+ @apply block fixed p-3 bg-background-secondary rounded-md border
+ border-background-tertiary bottom-4 right-4 text-transparent;
+ animation-name: showToTop;
+ animation-duration: 1ms;
+ animation-timeline: --showScrollTop;
+}
+
+.totop::after {
+ @apply block w-4 h-4 border-2 border-primary border-l-0 border-t-0;
+ content: "";
+ transform: translate(0, 25%) rotate(225deg);
+}
+
+html {
+ scroll-timeline: --showScrollTop y;
+ scroll-timeline: --showScrollTop vertical;
+}
+
+@keyframes showToTop {
+ 0% {
+ opacity: 0;
+ transform: translateY(300%);
+ }
+ 10% {
+ opacity: 1;
+ transform: translateY(0%);
+ }
+}
diff --git a/reference.page.jsx b/reference.page.jsx
index af39ee10..f707ecf6 100644
--- a/reference.page.jsx
+++ b/reference.page.jsx
@@ -4,6 +4,25 @@ import entityList from "@std/html/named-entity-list.json" with { type: "json" };
export const layout = "raw.tsx";
+export const sidebar = [
+ {
+ items: [
+ {
+ label: "Deno APIs",
+ id: "/api/deno/",
+ },
+ {
+ label: "Web APIs",
+ id: "/api/web/",
+ },
+ {
+ label: "Node APIs",
+ id: "/api/node/",
+ },
+ ],
+ },
+];
+
const resetRegexp =
/
\s*/;
const titleRegexp = /
(.+?)<\/title>\s*/s;
diff --git a/sidebar.client.ts b/sidebar.client.ts
index 1eb4984e..2f142322 100644
--- a/sidebar.client.ts
+++ b/sidebar.client.ts
@@ -18,6 +18,8 @@ for (const el of document.querySelectorAll("[data-accordion-trigger]")) {
}
const sidebar = document.getElementById("sidebar");
+console.log(sidebar);
+
if (sidebar) {
const sidebarNav = sidebar.querySelector("nav")!;
const sidebarOpen = document.getElementById("sidebar-open");
diff --git a/styles.css b/styles.css
index 47d07620..d9894718 100644
--- a/styles.css
+++ b/styles.css
@@ -4,10 +4,6 @@
@tailwind components;
@tailwind utilities;
-:root {
- --max-text-width: 65ch;
-}
-
/* Light and dark theme variables */
.light {
--background-primary: 215deg, 81%, 100%;
@@ -53,6 +49,10 @@
}
}
+html {
+ scroll-behavior: smooth;
+}
+
/* Scrollbar colors that look good on light and dark theme */
* {
scrollbar-color: hsla(0deg, 0%, 50%, 0.5) hsla(0deg, 0%, 50%, 0.1) !important;