Skip to content

Commit 742f3aa

Browse files
committed
feat(create-rstack): add i18n documentation template
1 parent f6bbc97 commit 742f3aa

25 files changed

Lines changed: 401 additions & 1 deletion

packages/create-rstack/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ npx create-rstack -d my-project -t app-vanilla-ts
3838
- `lib-solid-js` - JavaScript Solid library
3939
- `lib-solid-ts` - TypeScript Solid library
4040
- `doc-basic` - Basic documentation site
41+
- `doc-i18n` - Multilingual documentation site
4142

4243
## Documentation
4344

packages/create-rstack/src/index.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,26 @@ const getTemplateName = async ({ template }: Argv): Promise<string> => {
4444
);
4545

4646
if (projectType === 'doc') {
47-
return 'doc-basic';
47+
const documentationType = checkCancel<string>(
48+
await select({
49+
message: 'Choose documentation language setup',
50+
initialValue: 'basic',
51+
options: [
52+
{
53+
value: 'basic',
54+
label: 'Single language',
55+
hint: 'docs',
56+
},
57+
{
58+
value: 'i18n',
59+
label: 'Multilingual',
60+
hint: 'docs/en, docs/zh',
61+
},
62+
],
63+
}),
64+
);
65+
66+
return `doc-${documentationType}`;
4867
}
4968

5069
const templateType = checkCancel<string>(
@@ -101,6 +120,7 @@ await create({
101120
'lib-solid-js',
102121
'lib-solid-ts',
103122
'doc-basic',
123+
'doc-i18n',
104124
],
105125
builtinTools: [],
106126
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 multilingual 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)