Skip to content

Commit cf32b5f

Browse files
committed
render docs on pages using vitepress
1 parent 10847fe commit cf32b5f

File tree

11 files changed

+2549
-356
lines changed

11 files changed

+2549
-356
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export PATH=./bin:$PATH
22
use_mise
3+
use_nvm

.github/workflows/main.yml

+46
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,25 @@ on:
66
push:
77
branches:
88
- main
9+
# Sets permissions to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
# Allow only one concurrent deployment, skipping runs queued between
15+
# the run in-progress and latest queued. However, do NOT cancel
16+
# in-progress runs as we want to allow these production deployments to
17+
# complete.
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
922
jobs:
1023
test:
1124
runs-on: ubuntu-latest
25+
name: Test build
26+
env:
27+
DEBUG: 'vitepress:*'
1228
steps:
1329
- uses: actions/checkout@v4
1430
- uses: jdx/mise-action@v2
@@ -22,3 +38,33 @@ jobs:
2238
- name: W3C VC journey
2339
run: |
2440
make
41+
- name: Setup Node
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
cache: npm # or pnpm / yarn
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v4
48+
- name: Install dependencies
49+
run: npm ci # or pnpm install / yarn install / bun install
50+
- name: Build with VitePress
51+
run: |
52+
npm run docs:build
53+
ls -l src
54+
ls -l .vitepress/dist
55+
- name: Upload artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
path: .vitepress/dist
59+
60+
deploy:
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
needs: test
65+
runs-on: ubuntu-latest
66+
name: Deploy
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

.gitignore

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# bin/slexfe
22
bin/slangroom-exec
3-
*.json
3+
src/*.json
44
*.orig
55
*.rdf
66
*.slang
7-
7+
.vitepress/dist
8+
.vitepress/cache
9+
node_modules
10+
docs

.vitepress/config.mts

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "Zencode W3C VC",
6+
description: "Dyne.org W3C VC based on W3C standard and implemented using Zencode.",
7+
base: "/zencode-w3c-vc/",
8+
srcDir: "./src",
9+
themeConfig: {
10+
// https://vitepress.dev/reference/default-theme-config
11+
nav: [
12+
{ text: 'Home', link: '/' },
13+
{ text: 'DIDRoom', link: 'https://didroom.com' },
14+
{ text: 'Credimi', link: 'https://credimi.io' },
15+
{ text: 'Zenroom', link: 'https://zenroom.org' },
16+
{ text: 'Zencode', link: 'https://dev.zenroom.org' },
17+
{ text: 'Slangroom', link: 'https://dyne.org/slangroom' },
18+
],
19+
20+
sidebar: [
21+
{
22+
text: 'Use in your app',
23+
items: [
24+
{ text: 'How to embed', link: 'https://dev.zenroom.org/#/pages/how-to-embed' },
25+
{ text: 'Javascript', link: 'https://dev.zenroom.org/#/pages/javascript' },
26+
{ text: 'Python', link: 'https://dev.zenroom.org/#/pages/python' },
27+
{ text: 'Java', link: 'https://dev.zenroom.org/#/pages/java' }
28+
]
29+
}
30+
],
31+
32+
socialLinks: [
33+
{ icon: 'linkedin', link: 'https://linkedin.com/company/forkbomb' },
34+
{ icon: 'github', link: 'https://github.com/dyne/zencode-w3c-vc' }
35+
]
36+
}
37+
})

GNUmakefile

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
.PHONY: docs
2+
13
all:
2-
@rm -f src/*
4+
@rm -f src/*.json src/*.slang
35
@bats/bin/bats sign*bats
46
@bats/bin/bats verify*bats
57

68
check:
79
bats/bin/bats test.bats
810

911
deps:
10-
mise self-update
11-
mise install aqua:dyne/slangroom-exec@latest
12-
mise use aqua:dyne/slangroom-exec@latest
13-
eval `mise env`
12+
@mise self-update
13+
@mise install aqua:dyne/slangroom-exec@latest
14+
@mise use aqua:dyne/slangroom-exec@latest
15+
@npm i
16+
@eval `mise env`
17+
18+
docs:
19+
@npm run docs:build

0 commit comments

Comments
 (0)