An open API service indexing awesome lists of open source software.

https://github.com/v-poc/vpressdemo

Support demo import and preview for vitepress.
https://github.com/v-poc/vpressdemo

vitepress-demo-import vitepress-demo-preview vue-demo-preview

Last synced: 2 months ago
JSON representation

Support demo import and preview for vitepress.

Awesome Lists containing this project

README

        

# vpressdemo

[![npm](https://img.shields.io/npm/v/vpressdemo)](https://www.npmjs.com/package/vpressdemo)

## INTRODUCTION

> This is a lightweight demo to demonstrate `demo import and preview` based on VitePress.

## Usage

```
npm i -D vpressdemo shiki
```

```js
// .vitepress/config.ts / config.js
import vpressdemo from "../node_modules/vpressdemo/dist";
// ...
export default {
// ...
markdown: {
// ...
config: (md) => {
md.use(vpressdemo);
},
},
};
```

```js
// .vitepress/theme/index.ts / index.js
import DefaultTheme from "vitepress/theme";
import demo from "../../node_modules/vpressdemo/dist/demo.vue";
// ...
export default {
...DefaultTheme,
// ...
enhanceApp({ app }) {
app.component("demo", demo);
},
};
```

```

```

## Project setup

### How to setup your project

```
pnpm i
```

### Compiles and hot-reloads for development

```
pnpm start
```

### Compiles and minifies for production

```
pnpm run build
```

### Customize configuration

About vite, please check Configuration Reference - [vite](https://vitejs.dev/config/).

## License

MIT License