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

fix: cleanup styling for cli gen, remove node gen from ToC, add missing commands #940

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix: cleanup styling for cli gen, remove node gen from ToC, add missi…
…ng commands
  • Loading branch information
crowlKats committed Oct 3, 2024
commit 8a0f31b749a6c68abfd9215f6fe414251372f788
7 changes: 4 additions & 3 deletions _includes/doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);

Expand Down Expand Up @@ -556,9 +556,10 @@ function renderOption(group: string, arg, helpers: Lume.Helpers) {
return (
<>
<h3 id={id}>
{docsLink
<code>{docsLink
? <a href={docsLink}>{"--" + arg.name}</a>
: ("--" + arg.name)} <HeaderAnchor id={id} />
: ("--" + arg.name)}</code>
{" "}<HeaderAnchor id={id} />
</h3>
{arg.short && (
<p>
Expand Down
12 changes: 10 additions & 2 deletions runtime/_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down Expand Up @@ -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/",
Expand Down Expand Up @@ -318,7 +326,7 @@ export async function generateNodeCompatability() {
keyA.localeCompare(keyB)
).map(([key, content]) => {
let out =
`<div class="module-info compat-status-${content.status}">\n\n### [\`node:${key}\`](/api/node/${key})\n\n</div>\n\n`;
`<div class="module-info compat-status-${content.status}"><div class="compat-title"><a href="/api/node/${key}">node:${key}</a></div>\n\n`;

if (content) {
if (content.description) {
Expand All @@ -333,6 +341,6 @@ export async function generateNodeCompatability() {
}
}

return out;
return out + "</div>";
}).join("\n\n");
}
4 changes: 4 additions & 0 deletions runtime/reference/cli/add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "deno add"
command: add
---
2 changes: 2 additions & 0 deletions runtime/reference/cli/all_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions runtime/reference/cli/remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "deno remove"
command: remove
---
12 changes: 6 additions & 6 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down