diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts new file mode 100644 index 00000000..c1a44e43 --- /dev/null +++ b/docs/.vitepress/config.mts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vitepress' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "shadcn-vue", + description: "A VitePress Site" +}) diff --git a/docs/.vitepress/theme/Layout.vue b/docs/.vitepress/theme/Layout.vue new file mode 100644 index 00000000..f535b083 --- /dev/null +++ b/docs/.vitepress/theme/Layout.vue @@ -0,0 +1,21 @@ + + + diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts new file mode 100644 index 00000000..1a5c61c8 --- /dev/null +++ b/docs/.vitepress/theme/index.ts @@ -0,0 +1,11 @@ +// https://vitepress.dev/guide/custom-theme +import Layout from './Layout.vue' +import './style.css' + +export default { + Layout, + enhanceApp({ app, router, siteData }) { + // ... + } +} + diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css new file mode 100644 index 00000000..b57f839e --- /dev/null +++ b/docs/.vitepress/theme/style.css @@ -0,0 +1,5 @@ + +html { + font-family: Arial, Helvetica; +} + diff --git a/docs/api-examples.md b/docs/api-examples.md new file mode 100644 index 00000000..6bd8bb5c --- /dev/null +++ b/docs/api-examples.md @@ -0,0 +1,49 @@ +--- +outline: deep +--- + +# Runtime API Examples + +This page demonstrates usage of some of the runtime APIs provided by VitePress. + +The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: + +```md + + +## Results + +### Theme Data +
{{ theme }}
+ +### Page Data +
{{ page }}
+ +### Page Frontmatter +
{{ frontmatter }}
+``` + + + +## Results + +### Theme Data +
{{ theme }}
+ +### Page Data +
{{ page }}
+ +### Page Frontmatter +
{{ frontmatter }}
+ +## More + +Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..b1c72f40 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,4 @@ +--- +home: true +--- + diff --git a/docs/markdown-examples.md b/docs/markdown-examples.md new file mode 100644 index 00000000..8e55eb8a --- /dev/null +++ b/docs/markdown-examples.md @@ -0,0 +1,85 @@ +# Markdown Extension Examples + +This page demonstrates some of the built-in markdown extensions provided by VitePress. + +## Syntax Highlighting + +VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting: + +**Input** + +```` +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` +```` + +**Output** + +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` + +## Custom Containers + +**Input** + +```md +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: +``` + +**Output** + +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: + +## More + +Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown). diff --git a/package.json b/package.json index 56d3dccf..56fa8812 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "dev": "pnpm --filter www dev", "prepare": "pnpm simple-git-hooks", "lint": "eslint . --ignore-path .gitignore", - "lint:fix": "eslint . --fix --ignore-path .gitignore" + "lint:fix": "eslint . --fix --ignore-path .gitignore", + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" }, "devDependencies": { "@antfu/eslint-config": "^0.39.7", @@ -37,4 +40,4 @@ "lint-staged": { "*": "eslint --fix" } -} +} \ No newline at end of file