Skip to content

Commit f6bbc97

Browse files
authored
feat(create-rstack): add basic documentation template (#253)
1 parent ee7226e commit f6bbc97

17 files changed

Lines changed: 259 additions & 0 deletions

File tree

packages/create-rstack/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ npx create-rstack -d my-project -t app-vanilla-ts
3737
- `lib-vue-ts` - TypeScript Vue library
3838
- `lib-solid-js` - JavaScript Solid library
3939
- `lib-solid-ts` - TypeScript Solid library
40+
- `doc-basic` - Basic documentation site
4041

4142
## Documentation
4243

packages/create-rstack/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
2323
return `lib-${libraryType}-${language}`;
2424
}
2525

26+
if (template === 'doc' || template.startsWith('doc-')) {
27+
const [, documentationType = 'basic'] = template.split('-');
28+
return `doc-${documentationType}`;
29+
}
30+
2631
const [type, language = 'js'] = template.split('-');
2732
return `${type}-${language}`;
2833
}
@@ -33,10 +38,15 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
3338
options: [
3439
{ value: 'app', label: 'Web Application' },
3540
{ value: 'lib', label: 'Library' },
41+
{ value: 'doc', label: 'Documentation' },
3642
],
3743
}),
3844
);
3945

46+
if (projectType === 'doc') {
47+
return 'doc-basic';
48+
}
49+
4050
const templateType = checkCancel<string>(
4151
await select({
4252
message: projectType === 'app' ? 'Select framework' : 'Select library type',
@@ -90,6 +100,7 @@ await create({
90100
'lib-vue-ts',
91101
'lib-solid-js',
92102
'lib-solid-ts',
103+
'doc-basic',
93104
],
94105
builtinTools: [],
95106
getTemplateName,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# AGENTS.md
2+
3+
## Commands
4+
5+
- `{{ packageManager }} run dev` - Start the documentation development server
6+
- `{{ packageManager }} run build` - Build the documentation site for production
7+
- `{{ packageManager }} run preview` - Preview the production build locally
8+
9+
## Docs
10+
11+
- Rstack: https://rstack.rs/llms.txt
12+
- Rspress: https://rspress.rs/llms.txt
13+
- Rsbuild: https://rsbuild.rs/llms.txt
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Rstack documentation site
2+
3+
## Setup
4+
5+
Install the dependencies:
6+
7+
```bash
8+
{{ packageManager }} install
9+
```
10+
11+
## Get started
12+
13+
Start the development server:
14+
15+
```bash
16+
{{ packageManager }} run dev
17+
```
18+
19+
Build the website for production:
20+
21+
```bash
22+
{{ packageManager }} run build
23+
```
24+
25+
Preview the production build locally:
26+
27+
```bash
28+
{{ packageManager }} run preview
29+
```
30+
31+
## Learn more
32+
33+
- [Rstack documentation](https://rstack.rs)
34+
- [Rspress documentation](https://rspress.rs)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{
3+
"text": "Guide",
4+
"link": "/guide/start/introduction",
5+
"activeMatch": "/guide/"
6+
},
7+
{
8+
"text": "API",
9+
"link": "/api/",
10+
"activeMatch": "/api/"
11+
},
12+
{
13+
"text": "Rspress",
14+
"link": "https://rspress.rs/"
15+
}
16+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["index", "commands"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Commands
2+
3+
## dev
4+
5+
Start the local development server:
6+
7+
```bash
8+
rs doc
9+
```
10+
11+
## build
12+
13+
Build the documentation site for production:
14+
15+
```bash
16+
rs doc build
17+
```
18+
19+
## preview
20+
21+
Preview the production build locally:
22+
23+
```bash
24+
rs doc preview
25+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: API Overview
3+
overview: true
4+
---
5+
6+
This is an API Overview page which outlines all the available APIs.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"type": "dir-section-header",
4+
"name": "start",
5+
"label": "Getting Started"
6+
}
7+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["introduction"]

0 commit comments

Comments
 (0)