Skip to content

Commit fe543b0

Browse files
committed
feat: add documentation website
1 parent 1049afc commit fe543b0

22 files changed

+3357
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,6 @@ dist
173173

174174
# Finder (MacOS) folder config
175175
.DS_Store
176-
docs/
177176
/.releaserc
177+
178+
.astro/

bun.lock

Lines changed: 923 additions & 8 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"lint": "biome check"
2121
},
2222
"packageManager": "[email protected]",
23-
"workspaces": ["packages/*", "examples/*"],
23+
"workspaces": ["packages/*", "examples/*", "website"],
2424
"devDependencies": {
2525
"@biomejs/biome": "1.9.4",
2626
"@changesets/cli": "^2.28.1",

website/.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

website/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Starlight Docs
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
## 🚀 Project Structure
6+
7+
Inside of your Astro + Starlight project, you'll see the following folders and files:
8+
9+
```
10+
.
11+
├── public/
12+
├── src/
13+
│ ├── assets/
14+
│ ├── content/
15+
│ │ └── docs/
16+
│ └── content.config.ts
17+
├── astro.config.ts
18+
├── package.json
19+
└── tsconfig.json
20+
```
21+
22+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
23+
24+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
25+
26+
Static assets, like favicons, can be placed in the `public/` directory.
27+
28+
## 🧞 Commands
29+
30+
All commands are run from the root of the project, from a terminal:
31+
32+
| Command | Action |
33+
| :------------------------ | :----------------------------------------------- |
34+
| `bun install` | Installs dependencies |
35+
| `bun dev` | Starts local dev server at `localhost:4321` |
36+
| `bun build` | Build your production site to `./dist/` |
37+
| `bun preview` | Preview your build locally, before deploying |
38+
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
39+
| `bun astro -- --help` | Get help using the Astro CLI |
40+
41+
## 👀 Want to learn more?
42+
43+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

website/astro.config.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import starlight from "@astrojs/starlight";
2+
import { defineConfig } from "astro/config";
3+
4+
import tailwindcss from "@tailwindcss/vite";
5+
import starlightChangelogs from "starlight-changelogs";
6+
7+
const redirects = import.meta.env.REDIRECTS
8+
? JSON.parse(import.meta.env.REDIRECTS)
9+
: {};
10+
11+
// https://astro.build/config
12+
export default defineConfig({
13+
site: "https://retuple.pages.dev",
14+
redirects,
15+
integrations: [
16+
starlight({
17+
title: "reTuple",
18+
tagline: "reTuple",
19+
description:
20+
"A TypeScript utility for Go-style structured error handling combined with powerful tooling.",
21+
logo: {
22+
// TODO: add dark and light logo variants
23+
// dark: './src/assets/logo-dark.svg',
24+
// light: './src/assets/logo-light.svg',
25+
src: "./src/assets/logo.svg",
26+
},
27+
social: [
28+
{
29+
icon: "github",
30+
label: "GitHub",
31+
href: "https://github.com/maxmorozoff/try-catch-tuple",
32+
},
33+
],
34+
lastUpdated: true,
35+
editLink: {
36+
baseUrl:
37+
"https://github.com/maxmorozoff/try-catch-tuple/edit/main/website/",
38+
},
39+
customCss: [
40+
// Path to your Tailwind base styles:
41+
"./src/styles/global.css",
42+
"@fontsource/commit-mono",
43+
"@fontsource-variable/inter",
44+
],
45+
46+
plugins: [starlightChangelogs()],
47+
}),
48+
],
49+
50+
vite: {
51+
plugins: [tailwindcss()],
52+
},
53+
});

website/ec.config.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineEcConfig } from "@astrojs/starlight/expressive-code";
2+
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
3+
import ecTwoSlash from "expressive-code-twoslash";
4+
5+
export default defineEcConfig({
6+
themes: ["catppuccin-latte", "catppuccin-mocha"],
7+
plugins: [
8+
pluginLineNumbers(),
9+
ecTwoSlash({
10+
explicitTrigger: true,
11+
languages: ["ts", "tsx", "js", "jsx"],
12+
}),
13+
],
14+
defaultProps: {
15+
// Disable line numbers by default
16+
showLineNumbers: false,
17+
// But enable line numbers for certain languages
18+
// overridesByLang: {
19+
// 'js,ts,html': {
20+
// showLineNumbers: true,
21+
// },
22+
// },
23+
},
24+
});

website/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "website",
3+
"private": true,
4+
"type": "module",
5+
"version": "0.0.1",
6+
"scripts": {
7+
"dev": "astro dev",
8+
"start": "astro dev",
9+
"build": "astro build",
10+
"preview": "astro preview",
11+
"astro": "astro"
12+
},
13+
"dependencies": {
14+
"@astrojs/starlight": "^0.35.2",
15+
"@astrojs/starlight-tailwind": "^4.0.1",
16+
"@expressive-code/plugin-line-numbers": "^0.41.3",
17+
"@fontsource-variable/inter": "^5.2.6",
18+
"@fontsource/commit-mono": "^5.2.5",
19+
"@tailwindcss/vite": "^4.1.11",
20+
"astro": "^5.6.1",
21+
"expressive-code-twoslash": "^0.5.3",
22+
"sharp": "^0.34.2",
23+
"starlight-changelogs": "^0.1.1",
24+
"starlight-package-managers": "^0.11.0",
25+
"tailwindcss": "^4.1.11"
26+
},
27+
"devDependencies": {
28+
"typescript": "^5.9.2"
29+
}
30+
}

website/public/favicon.svg

Lines changed: 14 additions & 0 deletions
Loading

website/src/assets/logo.svg

Lines changed: 14 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)