diff --git a/src/components/WranglerCommand.astro b/src/components/WranglerCommand.astro index 97a2cf96f15ffb1..399473f414bb42e 100644 --- a/src/components/WranglerCommand.astro +++ b/src/components/WranglerCommand.astro @@ -5,6 +5,7 @@ import AnchorHeading from "./AnchorHeading.astro"; import { PackageManagers } from "starlight-package-managers"; import WranglerArg from "./WranglerArg.astro"; import Details from "./Details.astro"; +import { marked } from "marked"; function getCommand(path: string) { const segments = path.trim().split(/\s+/); @@ -37,6 +38,8 @@ let { command, headingLevel, description } = props.parse(Astro.props); const definition = getCommand(command); +description ??= definition.metadata.description; + if (!definition.args) { throw new Error(`[WranglerCommand] "${command}" has no arguments`); } @@ -48,9 +51,9 @@ const positionals = definition.positionalArgs .join(" "); --- - + -

{description ? description : definition.metadata.description}

+ + ``` @@ -33,4 +36,4 @@ import { WranglerCommand } from "~/components"; - `headingLevel` - The heading level that the command name should be added at on the page, i.e `2` for a `h2`. - `description` - - A description to render below the command heading. If not set, defaults to the value specified in the Wrangler help API. \ No newline at end of file + - A description to render below the command heading. If not set, defaults to the value specified in the Wrangler help API.