Skip to content

Commit 766f48f

Browse files
committed
[WranglerNamespace] Tweak for formatting
1 parent 204979f commit 766f48f

File tree

5 files changed

+13
-23
lines changed

5 files changed

+13
-23
lines changed

src/components/WranglerCommand.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ function getCommand(path: string) {
2929
3030
const props = z.object({
3131
command: z.string(),
32+
headingLevel: z.number().default(2)
3233
});
3334
34-
let { command } = props.parse(Astro.props);
35+
let { command, headingLevel } = props.parse(Astro.props);
3536
3637
const definition = getCommand(command);
3738
@@ -46,7 +47,7 @@ const positionals = definition.positionalArgs
4647
.join(" ");
4748
---
4849

49-
<AnchorHeading depth={2} title={command} />
50+
<AnchorHeading depth={headingLevel} title={command} />
5051

5152
<PackageManagers
5253
pkg="wrangler"

src/components/WranglerNamespace.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import WranglerCommand from "./WranglerCommand.astro";
55
66
const props = z.object({
77
namespace: z.string(),
8+
headingLevel: z.number().default(2)
89
});
910
10-
const { namespace } = props.parse(Astro.props);
11+
const { namespace, headingLevel } = props.parse(Astro.props);
1112
1213
const { registry } = experimental_getWranglerCommands();
1314
@@ -40,7 +41,7 @@ flattenSubtree(node.subtree);
4041
);
4142
}
4243
return (
43-
<WranglerCommand command={definition.command.replace("wrangler ", "")} />
44+
<WranglerCommand command={definition.command.replace("wrangler ", "")} headingLevel={headingLevel} />
4445
);
4546
})
4647
}

src/content/docs/hyperdrive/reference/wrangler-commands.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66

77
---
88

9-
import { Render } from "~/components";
9+
import { WranglerNamespace } from "~/components";
1010

11-
<Render file="hyperdrive" product="workers/wrangler-commands"/>
11+
The following [Wrangler commands](/workers/wrangler/) apply to Hyperdrive.
12+
13+
<WranglerNamespace namespace="hyperdrive" />

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Type,
1515
MetaInfo,
1616
WranglerConfig,
17+
WranglerNamespace,
1718
PackageManagers,
1819
} from "~/components";
1920

@@ -149,15 +150,15 @@ Interact with Cloudflare's D1 service.
149150

150151
Manage [Hyperdrive](/hyperdrive/) database configurations.
151152

152-
<Render file="wrangler-commands/hyperdrive" product="workers" />
153+
<WranglerNamespace namespace="hyperdrive" headingLevel={3}/>
153154

154155
---
155156

156157
## `vectorize`
157158

158159
Interact with a [Vectorize](/vectorize/) vector database.
159160

160-
<Render file="wrangler-commands/vectorize" product="workers" />
161+
<Render product="workers" file="wrangler-commands/vectorize" />
161162

162163
---
163164

src/content/partials/workers/wrangler-commands/hyperdrive.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)