Skip to content

feat: Set up comprehensive VitePress documentation site #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy Documentation

on:
push:
branches: [main]
paths: ['docs/**']
pull_request:
branches: [main]
paths: ['docs/**']

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: |
cd docs
npm ci

- name: Build with VitePress
run: |
cd docs
npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job (only on main branch)
deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

10 changes: 10 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
.vitepress/dist/
.vitepress/cache/
.DS_Store
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Trigger build
143 changes: 143 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'GrainChain Documentation',
description: 'Langchain for sandboxes - A powerful framework for building sandbox-aware AI applications',

// GitHub Pages deployment configuration
base: '/grainchain/',

// Ignore dead links for now (can be refined later)
ignoreDeadLinks: true,

themeConfig: {
// Navigation
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/' },
{ text: 'API', link: '/api/' },
{ text: 'CLI', link: '/cli/' },
{ text: 'Examples', link: '/examples/' },
{ text: 'Developer', link: '/developer/' }
],

// Sidebar
sidebar: {
'/guide/': [
{
text: 'Getting Started',
items: [
{ text: 'Introduction', link: '/guide/' },
{ text: 'Quick Start', link: '/guide/quick-start' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Configuration', link: '/guide/configuration' }
]
},
{
text: 'Core Concepts',
items: [
{ text: 'Design Overview', link: '/guide/design' },
{ text: 'Sandbox Integration', link: '/guide/sandbox-integration' },
{ text: 'Docker Setup', link: '/guide/docker-setup' },
{ text: 'Analysis Guide', link: '/guide/analysis' }
]
},
{
text: 'Advanced Topics',
items: [
{ text: 'Benchmarking', link: '/guide/benchmarking' },
{ text: 'Integration Patterns', link: '/guide/integration' },
{ text: 'Troubleshooting', link: '/guide/troubleshooting' }
]
}
],
'/api/': [
{
text: 'API Reference',
items: [
{ text: 'Overview', link: '/api/' },
{ text: 'Core Features', link: '/api/features' },
{ text: 'Providers', link: '/api/providers' },
{ text: 'Sandbox Management', link: '/api/sandbox' }
]
}
],
'/cli/': [
{
text: 'CLI Reference',
items: [
{ text: 'Overview', link: '/cli/' },
{ text: 'Commands', link: '/cli/commands' },
{ text: 'Configuration', link: '/cli/configuration' },
{ text: 'Examples', link: '/cli/examples' }
]
}
],
'/examples/': [
{
text: 'Examples',
items: [
{ text: 'Overview', link: '/examples/' },
{ text: 'Basic Usage', link: '/examples/basic' },
{ text: 'Advanced Patterns', link: '/examples/advanced' },
{ text: 'Integration Examples', link: '/examples/integrations' }
]
}
],
'/developer/': [
{
text: 'Developer Guide',
items: [
{ text: 'Overview', link: '/developer/' },
{ text: 'Contributing', link: '/developer/contributing' },
{ text: 'Architecture', link: '/developer/architecture' },
{ text: 'Testing', link: '/developer/testing' }
]
}
]
},

// Social links
socialLinks: [
{ icon: 'github', link: 'https://github.com/codegen-sh/grainchain' }
],

// Footer
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright Β© 2024 Codegen'
},

// Search
search: {
provider: 'local'
},

// Edit link
editLink: {
pattern: 'https://github.com/codegen-sh/grainchain/edit/main/docs/:path',
text: 'Edit this page on GitHub'
}
},

// Markdown configuration
markdown: {
lineNumbers: true,
theme: {
light: 'github-light',
dark: 'github-dark'
}
},

// Head configuration for SEO
head: [
['link', { rel: 'icon', href: '/grainchain/favicon.ico' }],
['meta', { name: 'theme-color', content: '#10b981' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:title', content: 'GrainChain Documentation' }],
['meta', { property: 'og:site_name', content: 'GrainChain Docs' }],
['meta', { property: 'og:url', content: 'https://codegen-sh.github.io/grainchain/' }],
['meta', { property: 'og:description', content: 'Langchain for sandboxes - A powerful framework for building sandbox-aware AI applications' }]
]
})
Loading