Skip to content

Commit ad09d42

Browse files
[feat] use vitepress to host docs
1 parent 28b32c9 commit ad09d42

15 files changed

+390
-45
lines changed

website/.vitepress/config.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
const gaScript = `
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments);}
6+
gtag('js', new Date());
7+
8+
gtag('config', 'G-EZSJ3YF2RG');
9+
`
10+
11+
export default defineConfig({
12+
lang: 'en-US',
13+
title: 'ast-grep',
14+
titleTemplate: 'ligthning fast code tool',
15+
base: '/ast-grep/',
16+
description: 'ast-grep(sg) is a ligthning fast and user friendly tool for code searching, linting, rewriting at large scale.',
17+
// head: [
18+
// ['script', {async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-EZSJ3YF2RG'}],
19+
// ['script', {}, gaScript],
20+
// ],
21+
outDir: './dist',
22+
themeConfig: {
23+
logo: 'logo.svg',
24+
nav: [
25+
{ text: 'Guide', link: '/guide' },
26+
{ text: 'Playground', link: '/playground' },
27+
],
28+
},
29+
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

website/guide/introduction.md

Whitespace-only changes.

website/guide/rule-config.md

Whitespace-only changes.

website/index.html

-22
This file was deleted.

website/index.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: ast-grep
6+
text: Write Code to Match Code
7+
tagline: ast-grep(sg) is a ligthning fast and user friendly tool for code searching, linting, rewriting at large scale.
8+
image:
9+
src: ../logo.svg
10+
alt: VitePress
11+
actions:
12+
- theme: brand
13+
text: Get Started
14+
link: /guide/introduction
15+
- theme: alt
16+
text: View on GitHub
17+
link: https://github.com/HerringtonDarkholme/ast-grep
18+
19+
features:
20+
- icon: ⚡️
21+
title: Performant
22+
details: Lorem ipsum...
23+
- icon: ⚡️
24+
title: Progressive
25+
details: Lorem ipsum...
26+
- icon: 🛠️
27+
title: Pragmatic
28+
details: Lorem ipsum...
29+
30+
---

website/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
8-
"build": "vue-tsc --noEmit && vite build",
9-
"preview": "vite preview"
7+
"dev": "vitepress dev",
8+
"build": "vue-tsc --noEmit && vitepress build",
9+
"serve": "vitepress serve"
1010
},
1111
"dependencies": {
1212
"@types/js-yaml": "^4.0.5",
@@ -20,7 +20,8 @@
2020
"ast-grep-wasm": "file:../crates/wasm/pkg/"
2121
},
2222
"devDependencies": {
23-
"@vitejs/plugin-vue": "3.1.0",
23+
"@algolia/client-search": "4.9.1",
24+
"vitepress": "^1.0.0-alpha.13",
2425
"typescript": "4.8.3",
2526
"vite": "3.1.0",
2627
"vue-tsc": "0.40.13"

website/playground.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: page
3+
---
4+
5+
<script setup>
6+
import App from './src/App.vue'
7+
</script>
8+
9+
<App/>

0 commit comments

Comments
 (0)