Skip to content

Commit baed588

Browse files
authored
Merge pull request #6 from rescript-lang/docs
Add initial docs
2 parents 29b94b3 + 9994707 commit baed588

25 files changed

+8950
-70
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
1116
jobs:
1217
build:
1318
runs-on: ubuntu-latest
@@ -36,6 +41,15 @@ jobs:
3641
- name: Run tests
3742
run: npm test
3843

44+
- name: Build documentation
45+
run: npm run build:docs
46+
47+
- name: Upload documentation
48+
uses: actions/upload-pages-artifact@v3
49+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
50+
with:
51+
path: ./dist
52+
3953
- name: get-npm-version
4054
id: package-version
4155
uses: martinbeentjes/[email protected]
@@ -61,3 +75,15 @@ jobs:
6175
env:
6276
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
6377
run: npm publish --access public ./*.tgz --tag experimental
78+
79+
deploy-docs:
80+
needs: build
81+
runs-on: ubuntu-latest
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
86+
steps:
87+
- name: Deploy to GitHub Pages
88+
id: deployment
89+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/node_modules/
22
/lib/
33
.bsb.lock
4+
.astro
5+
dist/

astro.config.mjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { readFileSync } from "node:fs";
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
5+
const rescriptTM = JSON.parse(
6+
readFileSync("./docs/assets/rescript.tmLanguage.json", "utf-8"),
7+
);
8+
9+
export default defineConfig({
10+
srcDir: "docs",
11+
publicDir: "docs/public",
12+
"site": "https://rescript-lang.github.io/experimental-rescript-webapi",
13+
integrations: [
14+
starlight({
15+
title: "Experimental WebAPI",
16+
logo: {
17+
src: "./docs/assets/rescript-logo.svg",
18+
},
19+
customCss: ["./docs/styles/fonts.css", "./docs/styles/theme.css"],
20+
expressiveCode: {
21+
shiki: {
22+
langs: [rescriptTM],
23+
},
24+
},
25+
}),
26+
],
27+
});

docs/assets/rescript-logo.svg

Lines changed: 53 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)