Skip to content
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

Set up docs #403

Merged
merged 14 commits into from
Sep 15, 2023
Merged
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
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ jobs:
yarn check
yarn build-wasm
yarn build
- name: Generate Docs
run: |
yarn docs:build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './packages/web-test/dist'
path: './dist'

deploy-web-test:
deploy:
needs: setup
# Deploy to the github-pages environment
environment:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,9 @@ preview/

lib
.parcel-cache

# api-extractor output folder
docs-src

# vitepress cache
.vitepress/cache
30 changes: 30 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Chopsticks (WIP)',
description: 'Chopsticks Types Documentation',
// Required for api-extractor markdown (https://github.com/vuejs/vitepress/pull/664)
markdown: { attrs: { disable: true } },
base: '/docs/',
srcDir: 'docs-src',
outDir: 'dist/docs',
rewrites: {
'chopsticks/:file': ':file',
'core/:file': ':file',
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [{ text: 'Home', link: '/' }],
sidebar: [
{
text: 'Packages',
items: [
{ text: 'Chopsticks', link: '/chopsticks.html' },
{ text: 'Core', link: '/chopsticks-core.html' },
],
},
],
socialLinks: [{ icon: 'github', link: 'https://github.com/AcalaNetwork/chopsticks' }],
},
})
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"test": "vitest run",
"test:watch": "vitest",
"start": "yarn script:start",
"dev": "yarn script:run"
"dev": "yarn script:run",
"docs:prep": "yarn workspaces foreach -pvit run docs:prep",
"docs:dev": "yarn docs:prep && vitepress dev",
"docs:build": "yarn docs:prep && vitepress build",
"docs:preview": "yarn docs:build && vitepress preview"
},
"engines": {
"node": ">=v14"
Expand All @@ -34,6 +38,8 @@
"*.{js,ts,css,md}": "prettier --write"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.22.33",
"@microsoft/api-extractor": "^7.36.4",
"@swc/core": "^1.3.78",
"@types/node": "^20.5.7",
"@types/prettier": "^3.0.0",
Expand All @@ -49,6 +55,7 @@
"typescript": "^5.1.6",
"unplugin-swc": "^1.4.2",
"vite-tsconfig-paths": "^4.2.0",
"vitepress": "^1.0.0-rc.13",
"vitest": "^0.34.2",
"wasm-pack": "^0.12.1"
},
Expand Down
Loading