Skip to content
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
29 changes: 29 additions & 0 deletions examples/documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Rspress website

## Setup

Install the dependencies:

```bash
npm install
Comment thread
chenjiahan marked this conversation as resolved.
```

## Get started

Start the dev server:

```bash
npm run dev
```

Build the website for production:

```bash
npm run build
```

Preview the production build locally:

```bash
npm run preview
```
11 changes: 11 additions & 0 deletions examples/documentation/docs/_nav.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"text": "API",
"link": "/api/",
"activeMatch": "/api/"
},
{
"text": "Document",
"link": "https://rspress.rs/"
}
]
1 change: 1 addition & 0 deletions examples/documentation/docs/api/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "commands"]
7 changes: 7 additions & 0 deletions examples/documentation/docs/api/commands.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Commands

## dev

## build

## preview
6 changes: 6 additions & 0 deletions examples/documentation/docs/api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: API Overview
overview: true
---

This is an API Overview page which outlines all the available APIs.
18 changes: 18 additions & 0 deletions examples/documentation/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
pageType: home

hero:
name: My Site
text: A cool website!
tagline: This is the tagline
actions:
- theme: brand
text: Quick Start
link: /api/
- theme: alt
text: GitHub
link: https://github.com/web-infra-dev/rspress
image:
src: https://assets.rspack.rs/rspress/rspress-logo.svg
alt: Logo
---
21 changes: 21 additions & 0 deletions examples/documentation/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@examples/documentation",
"private": true,
"type": "module",
"scripts": {
"build": "rs doc build",
"dev": "rs doc",
"lint": "rs lint",
"preview": "rs doc preview"
},
"dependencies": {
"rstack": "workspace:*"
},
"devDependencies": {
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"react": "catalog:",
"react-dom": "catalog:"
}
}
17 changes: 17 additions & 0 deletions examples/documentation/rstack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { define } from 'rstack';
import path from 'node:path';

define.doc({
root: path.join(import.meta.dirname, 'docs'),
title: 'My Site',
});

define.lint(async () => {
const { js, ts, reactPlugin, reactHooksPlugin } = await import('rstack/lint');
return [
js.configs.recommended,
ts.configs.recommended,
reactPlugin.configs.recommended,
reactHooksPlugin.configs.recommended,
];
});
26 changes: 26 additions & 0 deletions examples/documentation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"lib": ["DOM", "ES2020"],
"jsx": "react-jsx",
"target": "ES2020",
"noEmit": true,
"skipLibCheck": true,
"types": ["rstack/types", "node"],
"useDefineForClassFields": true,

/* modules */
"moduleDetection": "force",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["docs", "rstack.config.ts"],
"mdx": {
"checkMdx": true
}
}
32 changes: 27 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.