Skip to content

Vitepress

Installation

bash
pnpm add @sandboxrun/vue
bash
npm i @sandboxrun/vue

Setup

Add Vite Plugin

ts
// .vitepress/config.ts
import { defineConfig } from 'vitepress';
import { vitePlugin } from '@sandboxrun/vue'; 

export default defineConfig({
  vite: {
    plugins: [vitePlugin()], 
  },
});

Register Component

ts
// .vitepress/theme/index.ts
import type { Theme } from 'vitepress';
import DefaultTheme from 'vitepress/theme';
import { SandBoxRun } from '@sandboxrun/vue'; 
import '@sandboxrun/vue/style'; 

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    app.component('SandBoxRun', SandBoxRun); 
  },
} satisfies Theme;

Demo

Code in MarkDown

::: sandboxrun

```html

<div>Sandboxrun</div>

```

:::

Released under the MIT License.