Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ export default defineConfig({
],
plugins: [
starlightContextualMenu({
actions: ["copy", "view", "chatgpt", "claude"],
actions: [
"copy",
{
action: () => {
console.log("test");
},
label: "console.log",
},
"copy",
],
}),
],
sidebar: [
Expand Down
8 changes: 7 additions & 1 deletion packages/starlight-contextual-menu/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import type { StarlightPlugin } from "@astrojs/starlight/types";

type ContextualMenuActionType = "copy" | "view" | "claude" | "chatgpt";

interface ContextualMenuActionObject {
label: string;
icon?: string;
action: () => void;
}

export interface StarlightContextualMenuUserConfig {
actions: ContextualMenuActionType[];
actions: (ContextualMenuActionType | ContextualMenuActionObject)[];
}

export default function starlightContextualMenu(
Expand Down