create-vue-docs-ui
Version:
Scaffolding tool for Vue Docs UI projects - Create beautiful documentation websites with one command
138 lines (96 loc) ⢠2.74 kB
Markdown
Get Vue Docs UI up and running in your project with these simple steps.
Before you begin, make sure you have the following installed:
- **Node.js** 14.18+ or 16+
- **npm** 6+ or **yarn** 1.22+
The fastest way to get started is using our CLI tool:
```bash
npm create vue-docs-ui@latest my-docs
cd my-docs
npm install
npm run dev
```
Your documentation website will be running at `http://localhost:5173`!
If you prefer to set up Vue Docs UI manually in an existing project:
```bash
npm install vue-docs-ui
```
Create a `main.ts` file:
```typescript
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/:pathMatch(.*)*', redirect: '/' }
]
})
const app = createApp(App)
app.use(router)
app.mount('#app')
```
Create an `App.vue` file:
```vue
<template>
<DocsLayout />
</template>
<script setup lang="ts">
import { DocsLayout } from 'vue-docs-ui'
import 'vue-docs-ui/style.css'
</script>
```
Create a `public/config/site.yaml` file with your site configuration:
```yaml
site:
title: "My Documentation"
description: "My awesome documentation website"
logo: "š"
author: "Your Name"
```
Create your documentation files in the `public/docs/` directory as Markdown files.
After installation, your project structure should look like this:
```
my-docs/
āāā public/
ā āāā config/
ā ā āāā site.yaml
ā āāā docs/
ā āāā guide/
ā āāā introduction.md
āāā src/
ā āāā App.vue
ā āāā main.ts
āāā index.html
āāā package.json
āāā vite.config.js
```
Start the development server:
```bash
npm run dev
```
Your site will be available at `http://localhost:5173` with hot reload enabled.
Build your documentation for production:
```bash
npm run build
```
The built files will be in the `dist/` directory, ready to deploy to any static hosting service.
- [Quick Start Guide](/guide/quick-start) - Learn the basics
- [Configuration](/guide/configuration) - Customize your site
- [Examples](/examples) - See Vue Docs UI in action