Skip to content

Commit 8193c63

Browse files
committed
feat: add Astro docs site and GitHub Pages deployment
1 parent 48e3fd8 commit 8193c63

34 files changed

Lines changed: 9314 additions & 0 deletions

.github/workflows/deploy-docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
paths:
7+
- 'site/**'
8+
- '.github/workflows/deploy-docs.yml'
9+
- 'README.md'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
32+
cache: npm
33+
cache-dependency-path: site/package-lock.json
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v5
37+
38+
- name: Install dependencies
39+
working-directory: site
40+
run: npm ci
41+
42+
- name: Build docs
43+
working-directory: site
44+
run: npm run build
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: site/dist
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ PYTHONPATH=. uv run pytest # All tests
5858
PYTHONPATH=. uv run pytest test/test_tokenizer.py # Specific test file
5959
PYTHONPATH=. uv run pytest -k "generic" -v # Targeted tests
6060
uv run python scripts/verify_examples_e2e.py # Compile/build/run + output checks for all examples
61+
uv run python scripts/verify_error_stages.py # Error-stage audit across modes and formats
6162
```
6263

6364
## Compilation Pipeline
@@ -96,12 +97,21 @@ All AST traversals are iterative (no recursion) — the pipeline works with Pyth
9697

9798
## Learn More
9899

100+
- Documentation website: `https://airbus5717.github.io/a7-py/`
99101
- `docs/SPEC.md` - Language specification
100102
- `examples/` - 36 sample programs
101103
- `CLAUDE.md` - Development guide
102104
- `MISSING_FEATURES.md` - Feature status and roadmap
103105
- `CHANGELOG.md` - Change history
104106

107+
## Docs Development
108+
109+
```bash
110+
cd site
111+
npm install
112+
npm run dev
113+
```
114+
105115
---
106116

107117
Work in progress. Contributions welcome!

site/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

site/.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

site/.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

site/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# A7 Documentation Site
2+
3+
Astro + Starlight documentation site for the A7 compiler project.
4+
5+
## Local development
6+
7+
```bash
8+
cd site
9+
npm install
10+
npm run dev
11+
```
12+
13+
## Build
14+
15+
```bash
16+
cd site
17+
npm run build
18+
```
19+
20+
## Check
21+
22+
```bash
23+
cd site
24+
npm run check
25+
```
26+
27+
## Deployment
28+
29+
Deployment is handled by GitHub Actions workflow `.github/workflows/deploy-docs.yml`.
30+
31+
Production URL:
32+
33+
- `https://airbus5717.github.io/a7-py/`

site/astro.config.mjs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
site: 'https://airbus5717.github.io',
8+
base: '/a7-py',
9+
integrations: [
10+
starlight({
11+
title: 'A7 Compiler Docs',
12+
description: 'Documentation for the A7 language and the a7-py compiler.',
13+
favicon: '/favicon.svg',
14+
customCss: ['./src/styles/docs.css'],
15+
pagefind: false,
16+
social: [
17+
{
18+
icon: 'github',
19+
label: 'GitHub',
20+
href: 'https://github.com/airbus5717/a7-py',
21+
},
22+
],
23+
sidebar: [
24+
{
25+
label: 'Get Started',
26+
items: [
27+
{ label: 'Installation', slug: 'getting-started/installation' },
28+
{ label: 'Quickstart', slug: 'getting-started/quickstart' },
29+
],
30+
},
31+
{
32+
label: 'Compiler Usage',
33+
items: [
34+
{ label: 'CLI Reference', slug: 'compiler/cli-reference' },
35+
{ label: 'Modes and Output', slug: 'compiler/modes-and-output' },
36+
{ label: 'Pipeline Overview', slug: 'compiler/pipeline-overview' },
37+
],
38+
},
39+
{
40+
label: 'Language Guide',
41+
items: [
42+
{ label: 'Types', slug: 'language/types' },
43+
{
44+
label: 'Declarations and Expressions',
45+
slug: 'language/declarations-and-expressions',
46+
},
47+
{ label: 'Control Flow', slug: 'language/control-flow' },
48+
{ label: 'Functions', slug: 'language/functions' },
49+
{ label: 'Generics', slug: 'language/generics' },
50+
{ label: 'Memory Management', slug: 'language/memory-management' },
51+
{ label: 'Modules and Visibility', slug: 'language/modules-and-visibility' },
52+
{ label: 'Builtins and Operators', slug: 'language/builtins-and-operators' },
53+
{ label: 'Grammar Summary', slug: 'language/grammar-summary' },
54+
{ label: 'Diagnostics and Limits', slug: 'language/diagnostics-and-limits' },
55+
],
56+
},
57+
{
58+
label: 'Examples',
59+
items: [
60+
{ label: 'Examples Index', slug: 'examples/examples-index' },
61+
{ label: 'By Topic', slug: 'examples/by-topic' },
62+
],
63+
},
64+
{
65+
label: 'Project Status',
66+
items: [
67+
{ label: 'Changelog', slug: 'project/changelog' },
68+
{ label: 'Missing Features', slug: 'project/missing-features' },
69+
],
70+
},
71+
],
72+
}),
73+
],
74+
});

0 commit comments

Comments
 (0)