open-index/open-npm huggingface dataset:
npm package: @kubetail/starlight-contextual-menu
Description: Add contextual menu to your Starlight documentation.
Author: Corsfix
Latest version: 0.1.5-patch.2

# starlight-contextual-menu

Add contextual menu to your Starlight documentation.

![starlight-contextual-menu](https://raw.githubusercontent.com/corsfix/starlight-contextual-menu/refs/heads/main/docs/public/banner.png)

See it live on a real documentation page: [https://corsfix.com/docs/cors-proxy/api](https://corsfix.com/docs/cors-proxy/api)

## Usage

Install the plugin by running the following command:

```bash
npm i starlight-contextual-menu
```

Inside your astro.config.mjs file add the `starlightContextualMenu` plugin:

```js
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightContextualMenu from "starlight-contextual-menu";

export default defineConfig({
  integrations: [
    starlight({
      title: "My Docs",
      plugins: [starlightContextualMenu({
        actions: ["copy", "view", "chatgpt", "claude"]
      })],
      sidebar: [
        ...
      ],
    }),
  ],
});
```

There are 4 built in actions:

- `copy`: Copy page
- `view`: View as Markdown
- `chatgpt`: Open in ChatGPT
- `claude`: Open in Claude
- `lechat`: Open in Mistral Le Chat
- `grok`: Open in Grok

### Options

- `actions` (default: `['copy', 'view']`)
- `injectMarkdownRoutes` (default: `true`) — set to `false` if another Starlight integration already adds the markdown routes to avoid duplicate route registration.
- `hideMainActionLabel` (default: `false`) - set to `true` to hide the main action text and only show icon

By default, when not specifying actions, only `copy` and `view` will appear in the menu.

## License

[MIT](LICENSE)