From 8a0f31b749a6c68abfd9215f6fe414251372f788 Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 3 Oct 2024 20:52:49 +0200 Subject: [PATCH 1/2] fix: cleanup styling for cli gen, remove node gen from ToC, add missing commands --- _includes/doc.tsx | 7 ++++--- runtime/_data.ts | 12 ++++++++++-- runtime/reference/cli/add.md | 4 ++++ runtime/reference/cli/all_commands.md | 2 ++ runtime/reference/cli/remove.md | 4 ++++ styles.css | 12 ++++++------ 6 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 runtime/reference/cli/add.md create mode 100644 runtime/reference/cli/remove.md diff --git a/_includes/doc.tsx b/_includes/doc.tsx index d001f944f..827a8a989 100644 --- a/_includes/doc.tsx +++ b/_includes/doc.tsx @@ -495,7 +495,7 @@ function renderCommand( {Object.entries(options).map(([heading, flags]) => { const id = heading.toLowerCase().replace(/\s/g, "-"); - const renderedFlags = flags.map((flag) => + const renderedFlags = flags.toSorted((a, b) => a.name.localeCompare(b.name)).map((flag) => renderOption(id, flag, helpers) ); @@ -556,9 +556,10 @@ function renderOption(group: string, arg, helpers: Lume.Helpers) { return ( <>

- {docsLink + {docsLink ? {"--" + arg.name} - : ("--" + arg.name)} + : ("--" + arg.name)} + {" "}

{arg.short && (

diff --git a/runtime/_data.ts b/runtime/_data.ts index 19b338578..692576d83 100644 --- a/runtime/_data.ts +++ b/runtime/_data.ts @@ -51,6 +51,10 @@ export const sidebar = [ label: "Environment Variables", id: "/runtime/reference/cli/env_variables/", }, + { + label: "deno add", + id: "/runtime/reference/cli/add/", + }, { label: "deno bench", id: "/runtime/reference/cli/benchmarker/", @@ -115,6 +119,10 @@ export const sidebar = [ label: "LSP integration", id: "/runtime/reference/cli/lsp_integration/", }, + { + label: "deno remove", + id: "/runtime/reference/cli/remove/", + }, { label: "deno repl", id: "/runtime/reference/cli/repl/", @@ -318,7 +326,7 @@ export async function generateNodeCompatability() { keyA.localeCompare(keyB) ).map(([key, content]) => { let out = - `

\n\n### [\`node:${key}\`](/api/node/${key})\n\n
\n\n`; + `
\n\n`; if (content) { if (content.description) { @@ -333,6 +341,6 @@ export async function generateNodeCompatability() { } } - return out; + return out + "
"; }).join("\n\n"); } diff --git a/runtime/reference/cli/add.md b/runtime/reference/cli/add.md new file mode 100644 index 000000000..9213991e9 --- /dev/null +++ b/runtime/reference/cli/add.md @@ -0,0 +1,4 @@ +--- +title: "deno add" +command: add +--- diff --git a/runtime/reference/cli/all_commands.md b/runtime/reference/cli/all_commands.md index 2a1a2679b..27415d89f 100644 --- a/runtime/reference/cli/all_commands.md +++ b/runtime/reference/cli/all_commands.md @@ -8,6 +8,7 @@ runtime environment from your terminal or command prompt. The CLI has a number of subcommands that can be used to perform different tasks, check the links below for more information on each subcommand. +- [deno add](/runtime/reference/cli/add) - Add dependencies - [deno bench](/runtime/reference/cli/benchmarker/) - benchmarking tool - [deno check](/runtime/reference/cli/check/) - type check your program without running it @@ -30,6 +31,7 @@ below for more information on each subcommand. - [deno lint](/runtime/reference/cli/linter/) - lint your code - [deno lsp](/runtime/reference/cli/lsp/) - language server protocol integration - [deno publish](/runtime/reference/cli/publish/) - publish a module +- [deno remove](/runtime/reference/cli/remove) - Remove dependencies - [deno repl](/runtime/reference/cli/repl/) - starts a read-eval-print-loop - [deno run](/runtime/reference/cli/run/) - run a script - [deno serve](/runtime/reference/cli/serve/) - run a web server diff --git a/runtime/reference/cli/remove.md b/runtime/reference/cli/remove.md new file mode 100644 index 000000000..a2daa05d1 --- /dev/null +++ b/runtime/reference/cli/remove.md @@ -0,0 +1,4 @@ +--- +title: "deno remove" +command: remove +--- diff --git a/styles.css b/styles.css index 64ff50c43..7b70ed54a 100644 --- a/styles.css +++ b/styles.css @@ -318,12 +318,12 @@ body:not(:has(.ddoc)) { @apply mt-4; } -.markdown-body .module-info > h3 { +.markdown-body .module-info > .compat-title { @apply text-lg mt-0 mb-1 flex flex-row items-center font-semibold; } -.markdown-body .module-info > h3 > a > code { - @apply bg-white pl-2; +.markdown-body .module-info > .compat-title a { + @apply pl-2 font-mono; } .markdown-body .module-info > p { @@ -350,7 +350,7 @@ body:not(:has(.ddoc)) { @apply text-red-500; } -.markdown-body .module-info.compat-status-good > h3::before { +.markdown-body .module-info.compat-status-good > .compat-title::before { content: ""; display: inline-block; width: 1.5rem; @@ -360,7 +360,7 @@ body:not(:has(.ddoc)) { background-repeat: no-repeat; } -.markdown-body .module-info.compat-status-partial > h3::before { +.markdown-body .module-info.compat-status-partial > .compat-title::before { content: ""; display: inline-block; width: 1.5rem; @@ -370,7 +370,7 @@ body:not(:has(.ddoc)) { background-repeat: no-repeat; } -.markdown-body .module-info.compat-status-unsupported > h3::before { +.markdown-body .module-info.compat-status-unsupported > .compat-title::before { content: ""; display: inline-block; width: 1.5rem; From b65841e29e5d454d58443d28fedffbdc9c8e633a Mon Sep 17 00:00:00 2001 From: crowlkats Date: Thu, 3 Oct 2024 20:52:55 +0200 Subject: [PATCH 2/2] fmt --- _includes/doc.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/_includes/doc.tsx b/_includes/doc.tsx index 827a8a989..0a425202b 100644 --- a/_includes/doc.tsx +++ b/_includes/doc.tsx @@ -495,9 +495,9 @@ function renderCommand( {Object.entries(options).map(([heading, flags]) => { const id = heading.toLowerCase().replace(/\s/g, "-"); - const renderedFlags = flags.toSorted((a, b) => a.name.localeCompare(b.name)).map((flag) => - renderOption(id, flag, helpers) - ); + const renderedFlags = flags.toSorted((a, b) => + a.name.localeCompare(b.name) + ).map((flag) => renderOption(id, flag, helpers)); toc.push({ text: heading, @@ -556,10 +556,12 @@ function renderOption(group: string, arg, helpers: Lume.Helpers) { return ( <>

- {docsLink - ? {"--" + arg.name} - : ("--" + arg.name)} - {" "} + + {docsLink + ? {"--" + arg.name} + : ("--" + arg.name)} + {" "} +

{arg.short && (