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

Migrate docs to starlight #29

Merged
merged 10 commits into from
Jun 2, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test docs deployment
name: Check docs

on:
pull_request:
Expand All @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
with:
version: 8.11.0
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
cache-dependency-path: ./docs/pnpm-lock.yaml

Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/docs.yml

This file was deleted.

4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"files": {
"ignore": [
"./docs/.docusaurus",
"./docs/build",
"./docs/.astro",
"./docs/dist",
"./out",
"./test/out",
"./package.json"
Expand Down
31 changes: 16 additions & 15 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Dependencies
/node_modules
# build output
dist/
# generated types
.astro/

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
59 changes: 36 additions & 23 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
# Commander Docs
# Starlight Starter Kit: Basics

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
$ npm i
npm create astro@latest -- --template starlight
```

### Local Development
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

```
$ npm run start
```
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
## 🚀 Project Structure

### Build
Inside of your Astro + Starlight project, you'll see the following folders and files:

```
$ npm run build
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
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.

### Deployment
Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Using SSH:
Static assets, like favicons, can be placed in the `public/` directory.

```
$ USE_SSH=true npm run deploy
```
## 🧞 Commands

Not using SSH:
All commands are run from the root of the project, from a terminal:

```
$ GIT_USER=<Your GitHub username> npm run deploy
```
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
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).
59 changes: 59 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";

import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "Commander",
description: "Flexible command framework for roblox-ts",
social: {
github: "https://github.com/paradoxuum/commander",
discord: "https://discord.roblox-ts.com/",
},
logo: {
dark: "src/assets/logo-dark.svg",
light: "src/assets/logo-light.svg",
},
sidebar: [
{
label: "Quick Start",
items: [
{
label: "Getting Started",
link: "getting-started",
},
{
label: "Examples",
link: "examples",
},
],
},
{
label: "Commands",
autogenerate: {
directory: "commands",
},
},
{
label: "Types",
autogenerate: {
directory: "types",
},
},
{
label: "Registration",
autogenerate: {
directory: "registration",
},
},
],
customCss: ["./src/tailwind.css", "./src/custom.css"],
}),
tailwind({
applyBaseStyles: false,
}),
],
});
3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

53 changes: 0 additions & 53 deletions docs/docs/getting-started/installation.mdx

This file was deleted.

Loading