create-rspress 2.0.12 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +17 -2
  2. package/dist/index.js +33 -14
  3. package/package.json +6 -6
  4. package/template-basic/docs/_nav.json +16 -0
  5. package/template-basic/docs/api/_meta.json +1 -0
  6. package/template-basic/docs/api/commands.mdx +7 -0
  7. package/template-basic/docs/api/index.mdx +6 -0
  8. package/template-basic/docs/guide/_meta.json +12 -0
  9. package/template-basic/docs/guide/start/_meta.json +1 -0
  10. package/template-basic/docs/guide/start/getting-started.md +51 -0
  11. package/template-basic/docs/guide/start/introduction.md +15 -0
  12. package/template-basic/docs/guide/use-mdx/_meta.json +1 -0
  13. package/template-basic/docs/guide/use-mdx/code-blocks/_meta.json +1 -0
  14. package/template-basic/docs/guide/use-mdx/code-blocks/index.mdx +9 -0
  15. package/template-basic/docs/guide/use-mdx/code-blocks/meta.md +7 -0
  16. package/template-basic/docs/guide/use-mdx/code-blocks/title.md +5 -0
  17. package/template-basic/docs/guide/use-mdx/components.mdx +47 -0
  18. package/template-basic/docs/guide/use-mdx/container.md +33 -0
  19. package/template-basic/docs/index.md +43 -0
  20. package/template-basic-theme/theme/index.css +12 -0
  21. package/template-basic-theme/theme/index.tsx +4 -0
  22. package/template-common/package.json +2 -2
  23. package/template-common/rspress.config.ts +1 -0
  24. package/template-i18n/docs/en/_nav.json +16 -0
  25. package/template-i18n/docs/en/api/_meta.json +1 -0
  26. package/template-i18n/docs/en/api/commands.mdx +11 -0
  27. package/template-i18n/docs/en/api/index.mdx +7 -0
  28. package/template-i18n/docs/en/guide/_meta.json +12 -0
  29. package/template-i18n/docs/en/guide/start/_meta.json +1 -0
  30. package/template-i18n/docs/en/guide/start/getting-started.md +55 -0
  31. package/template-i18n/docs/en/guide/start/introduction.md +19 -0
  32. package/template-i18n/docs/en/guide/use-mdx/_meta.json +1 -0
  33. package/template-i18n/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
  34. package/template-i18n/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
  35. package/template-i18n/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
  36. package/template-i18n/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
  37. package/template-i18n/docs/en/guide/use-mdx/components.mdx +51 -0
  38. package/template-i18n/docs/en/guide/use-mdx/container.md +37 -0
  39. package/template-i18n/docs/en/index.md +44 -0
  40. package/template-i18n/docs/zh/_nav.json +16 -0
  41. package/template-i18n/docs/zh/api/_meta.json +12 -0
  42. package/template-i18n/docs/zh/api/commands.mdx +11 -0
  43. package/template-i18n/docs/zh/api/index.mdx +7 -0
  44. package/template-i18n/docs/zh/guide/_meta.json +12 -0
  45. package/template-i18n/docs/zh/guide/start/_meta.json +12 -0
  46. package/template-i18n/docs/zh/guide/start/getting-started.md +55 -0
  47. package/template-i18n/docs/zh/guide/start/introduction.md +19 -0
  48. package/template-i18n/docs/zh/guide/use-mdx/_meta.json +17 -0
  49. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
  50. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
  51. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
  52. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
  53. package/template-i18n/docs/zh/guide/use-mdx/components.mdx +51 -0
  54. package/template-i18n/docs/zh/guide/use-mdx/container.md +37 -0
  55. package/template-i18n/docs/zh/index.md +44 -0
  56. package/template-i18n/rspress.config.ts +37 -0
  57. package/template-i18n-theme/docs/en/_nav.json +16 -0
  58. package/template-i18n-theme/docs/en/api/_meta.json +1 -0
  59. package/template-i18n-theme/docs/en/api/commands.mdx +11 -0
  60. package/template-i18n-theme/docs/en/api/index.mdx +7 -0
  61. package/template-i18n-theme/docs/en/guide/_meta.json +12 -0
  62. package/template-i18n-theme/docs/en/guide/start/_meta.json +1 -0
  63. package/template-i18n-theme/docs/en/guide/start/getting-started.md +55 -0
  64. package/template-i18n-theme/docs/en/guide/start/introduction.md +19 -0
  65. package/template-i18n-theme/docs/en/guide/use-mdx/_meta.json +1 -0
  66. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
  67. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
  68. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
  69. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
  70. package/template-i18n-theme/docs/en/guide/use-mdx/components.mdx +51 -0
  71. package/template-i18n-theme/docs/en/guide/use-mdx/container.md +37 -0
  72. package/template-i18n-theme/docs/en/index.md +44 -0
  73. package/template-i18n-theme/docs/zh/_nav.json +16 -0
  74. package/template-i18n-theme/docs/zh/api/_meta.json +12 -0
  75. package/template-i18n-theme/docs/zh/api/commands.mdx +11 -0
  76. package/template-i18n-theme/docs/zh/api/index.mdx +7 -0
  77. package/template-i18n-theme/docs/zh/guide/_meta.json +12 -0
  78. package/template-i18n-theme/docs/zh/guide/start/_meta.json +12 -0
  79. package/template-i18n-theme/docs/zh/guide/start/getting-started.md +55 -0
  80. package/template-i18n-theme/docs/zh/guide/start/introduction.md +19 -0
  81. package/template-i18n-theme/docs/zh/guide/use-mdx/_meta.json +17 -0
  82. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
  83. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
  84. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
  85. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
  86. package/template-i18n-theme/docs/zh/guide/use-mdx/components.mdx +51 -0
  87. package/template-i18n-theme/docs/zh/guide/use-mdx/container.md +37 -0
  88. package/template-i18n-theme/docs/zh/index.md +44 -0
  89. package/template-i18n-theme/rspress.config.ts +37 -0
  90. package/template-i18n-theme/theme/env.d.ts +9 -0
  91. package/template-i18n-theme/theme/index.css +12 -0
  92. package/template-i18n-theme/theme/index.tsx +4 -0
  93. package/template-basic/template-placeholder +0 -1
  94. package/template-custom-theme/theme/index.css +0 -6
  95. package/template-custom-theme/theme/index.tsx +0 -3
  96. /package/{template-common → template-basic-theme}/docs/_nav.json +0 -0
  97. /package/{template-common → template-basic-theme}/docs/api/_meta.json +0 -0
  98. /package/{template-common → template-basic-theme}/docs/api/commands.mdx +0 -0
  99. /package/{template-common → template-basic-theme}/docs/api/index.mdx +0 -0
  100. /package/{template-common → template-basic-theme}/docs/guide/_meta.json +0 -0
  101. /package/{template-common → template-basic-theme}/docs/guide/start/_meta.json +0 -0
  102. /package/{template-common → template-basic-theme}/docs/guide/start/getting-started.md +0 -0
  103. /package/{template-common → template-basic-theme}/docs/guide/start/introduction.md +0 -0
  104. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/_meta.json +0 -0
  105. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/_meta.json +0 -0
  106. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/index.mdx +0 -0
  107. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/meta.md +0 -0
  108. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/title.md +0 -0
  109. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/components.mdx +0 -0
  110. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/container.md +0 -0
  111. /package/{template-common → template-basic-theme}/docs/index.md +0 -0
  112. /package/{template-custom-theme → template-basic-theme}/theme/env.d.ts +0 -0
package/README.md CHANGED
@@ -16,10 +16,25 @@ npx create-rspress --dir my-project
16
16
  # Using abbreviations
17
17
  npx create-rspress -d my-project
18
18
 
19
- # Scaffold with the custom theme template
20
- npx create-rspress --dir my-project --template custom-theme
19
+ # Scaffold with the basic theme template
20
+ npx create-rspress --dir my-project --template basic-theme
21
+
22
+ # Scaffold with the multilingual template
23
+ npx create-rspress --dir my-project --template i18n
24
+
25
+ # Scaffold with the multilingual theme template
26
+ npx create-rspress --dir my-project --template i18n-theme
21
27
  ```
22
28
 
29
+ Available templates:
30
+
31
+ | Template | Description |
32
+ | ------------- | --------------------------------------------------------------------------- |
33
+ | `basic` | Creates a minimal Rspress documentation site with the default theme. |
34
+ | `basic-theme` | Creates a single-language site with a `theme` folder for customization. |
35
+ | `i18n` | Creates a multilingual documentation site with English and Chinese content. |
36
+ | `i18n-theme` | Creates a multilingual site with a `theme` folder for customization. |
37
+
23
38
  ## Documentation
24
39
 
25
40
  https://rspress.rs/
package/dist/index.js CHANGED
@@ -4,28 +4,50 @@ import { checkCancel, create, select as external_create_rstack_select } from "cr
4
4
  const src_dirname = node_path.dirname(fileURLToPath(import.meta.url));
5
5
  const templates = [
6
6
  'basic',
7
- 'custom-theme'
7
+ 'basic-theme',
8
+ 'i18n',
9
+ 'i18n-theme'
8
10
  ];
11
+ function isTemplateName(templateName) {
12
+ return templates.includes(templateName);
13
+ }
9
14
  async function getTemplateName(argv) {
10
15
  if (argv.template) {
11
- if (templates.includes(argv.template)) return argv.template;
16
+ if (isTemplateName(argv.template)) return argv.template;
12
17
  throw new Error(`Invalid template "${argv.template}". Expected one of: ${templates.join(', ')}.`);
13
18
  }
14
- return checkCancel(await external_create_rstack_select({
15
- message: 'Would you like to customize the theme styles?',
16
- initialValue: 'custom-theme',
19
+ const i18nChoice = checkCancel(await external_create_rstack_select({
20
+ message: 'Choose documentation language setup',
21
+ initialValue: 'basic',
17
22
  options: [
18
23
  {
19
- value: 'custom-theme',
20
- label: 'Yes, set up a "theme" folder for customization',
21
- hint: 'Modify styles and components later.'
24
+ value: 'basic',
25
+ label: 'Single language',
26
+ hint: 'docs'
22
27
  },
23
28
  {
24
- value: 'basic',
25
- label: 'No, use the default theme'
29
+ value: 'i18n',
30
+ label: 'Multilingual',
31
+ hint: 'docs/en, docs/zh'
26
32
  }
27
33
  ]
28
34
  }));
35
+ const themeChoice = checkCancel(await external_create_rstack_select({
36
+ message: 'Choose theme customization setup',
37
+ initialValue: 'with-theme',
38
+ options: [
39
+ {
40
+ value: 'with-theme',
41
+ label: 'Custom theme',
42
+ hint: 'theme/'
43
+ },
44
+ {
45
+ value: 'default-theme',
46
+ label: 'Default theme'
47
+ }
48
+ ]
49
+ }));
50
+ return 'with-theme' === themeChoice ? `${i18nChoice}-theme` : i18nChoice;
29
51
  }
30
52
  function mapESLintTemplate() {
31
53
  return 'react-ts';
@@ -36,9 +58,6 @@ function mapRslintTemplate() {
36
58
  create({
37
59
  root: node_path.resolve(src_dirname, '..'),
38
60
  name: 'rspress',
39
- skipFiles: [
40
- 'template-placeholder'
41
- ],
42
61
  templates: [
43
62
  ...templates
44
63
  ],
@@ -55,7 +74,7 @@ create({
55
74
  value: 'rspress-custom-theme',
56
75
  label: 'Rspress custom theme',
57
76
  source: 'rstackjs/agent-skills',
58
- when: (templateName)=>'custom-theme' === templateName
77
+ when: ({ templateName })=>templateName.endsWith('-theme')
59
78
  },
60
79
  {
61
80
  value: "rspress-description-generator",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rspress",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "Create a new Rspress project",
5
5
  "homepage": "https://rspress.rs",
6
6
  "repository": {
@@ -18,16 +18,16 @@
18
18
  "create-rspress": "./bin.js"
19
19
  },
20
20
  "files": [
21
- "template-*",
21
+ "template-*/**",
22
22
  "dist",
23
23
  "bin.js"
24
24
  ],
25
25
  "dependencies": {
26
- "create-rstack": "2.1.2"
26
+ "create-rstack": "2.1.3"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.57.7",
30
- "@rslib/core": "0.21.5",
30
+ "@rslib/core": "0.22.0",
31
31
  "@types/node": "^22.8.1",
32
32
  "rsbuild-plugin-publint": "^0.3.4",
33
33
  "typescript": "^6.0.3"
@@ -40,8 +40,8 @@
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
42
  "scripts": {
43
- "build": "rslib build",
44
- "dev": "rslib build -w",
43
+ "build": "node ./scripts/generate-theme-templates.mjs && rslib build",
44
+ "dev": "node ./scripts/generate-theme-templates.mjs && rslib build -w",
45
45
  "start": "node ./dist/index.js"
46
46
  }
47
47
  }
@@ -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": "Document",
14
+ "link": "https://rspress.rs/"
15
+ }
16
+ ]
@@ -0,0 +1 @@
1
+ ["index", "commands"]
@@ -0,0 +1,7 @@
1
+ # Commands
2
+
3
+ ## dev
4
+
5
+ ## build
6
+
7
+ ## preview
@@ -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.
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "dir-section-header",
4
+ "name": "start",
5
+ "label": "Getting Started"
6
+ },
7
+ {
8
+ "type": "dir-section-header",
9
+ "name": "use-mdx",
10
+ "label": "Markdown & MDX"
11
+ }
12
+ ]
@@ -0,0 +1 @@
1
+ ["introduction", "getting-started"]
@@ -0,0 +1,51 @@
1
+ # Getting started
2
+
3
+ ## Project structure
4
+
5
+ After creating a project with `create-rspress`, you will get the following project structure:
6
+
7
+ - `docs/` — The documentation source directory, configured via `root` in `rspress.config.ts`.
8
+ - `docs/_nav.json` — The navigation bar configuration.
9
+ - `docs/guide/_meta.json` — The sidebar configuration for the guide section.
10
+ - `docs/public/` — Static assets directory.
11
+ - `theme/` — Optional custom theme directory, generated when you choose the custom theme scaffold.
12
+ - `rspress.config.ts` — The Rspress configuration file.
13
+
14
+ ## Development
15
+
16
+ Start the local development server:
17
+
18
+ ```bash
19
+ npm run dev
20
+ ```
21
+
22
+ :::tip
23
+
24
+ You can specify the port number or host with `--port` or `--host`, such as `rspress dev --port 8080 --host 0.0.0.0`.
25
+
26
+ :::
27
+
28
+ ## Production build
29
+
30
+ Build the site for production:
31
+
32
+ ```bash
33
+ npm run build
34
+ ```
35
+
36
+ By default, Rspress will output to `doc_build` directory.
37
+
38
+ ## Preview
39
+
40
+ Preview the production build locally:
41
+
42
+ ```bash
43
+ npm run preview
44
+ ```
45
+
46
+ ## Next steps
47
+
48
+ - Learn how to use [MDX & React Components](/guide/use-mdx/components) in your docs.
49
+ - Learn about [Code Blocks](/guide/use-mdx/code-blocks/) syntax highlighting and line highlighting.
50
+ - Learn about [Custom Containers](/guide/use-mdx/container) for tips, warnings, and more.
51
+ - Explore the full [Rspress documentation](https://rspress.rs/) for advanced features.
@@ -0,0 +1,15 @@
1
+ # Introduction
2
+
3
+ Rspress is a static site generator based on [Rsbuild](https://rsbuild.rs/), rendered with the React framework. It comes with a default documentation theme, and you can quickly build a documentation site with Rspress.
4
+
5
+ ## Why Rspress
6
+
7
+ - **Build Performance**. The core compilation module is based on the Rust front-end toolchain, providing millisecond-level startup and a more ultimate development experience.
8
+ - **AI-native**. Technical documentation not only serves human readers but can also be better understood and utilized by AI through SSG-MD.
9
+ - **MDX Support**. MDX is a powerful way to write content, allowing you to use React components in Markdown.
10
+ - **Basic Capabilities**. Including full-text search, internationalization, multi-version support, component library documentation, etc.
11
+ - **Extensibility**. Provides a built-in plugin system, supports extending Rspress through plugin API.
12
+
13
+ ## Try Rspress
14
+
15
+ Go to [Getting Started](/guide/start/getting-started) to learn how to use Rspress to build a documentation site.
@@ -0,0 +1 @@
1
+ ["components", { "type": "dir", "name": "code-blocks" }, "container"]
@@ -0,0 +1 @@
1
+ ["title", "meta"]
@@ -0,0 +1,9 @@
1
+ # Code blocks
2
+
3
+ Rspress uses [Shiki](https://shiki.style) for syntax highlighting at compile time, which means better runtime performance.
4
+
5
+ When using code blocks in multiple languages, the corresponding language is automatically detected at compile time, and the runtime bundle size does not increase. For supported programming languages, refer to the [Shiki supported languages list](https://shiki.style/languages).
6
+
7
+ ```js
8
+ console.log('Hello World');
9
+ ```
@@ -0,0 +1,7 @@
1
+ # Meta
2
+
3
+ Besides the title, we also have some other meta attributes.
4
+
5
+ ```ts lineNumbers wrapCode title="example.ts"
6
+ const longLine = 'This code block has line numbers, code wrapping, and a title';
7
+ ```
@@ -0,0 +1,5 @@
1
+ # Title
2
+
3
+ ```js title="foo.js"
4
+ console.log('Hello World');
5
+ ```
@@ -0,0 +1,47 @@
1
+ # MDX & React components
2
+
3
+ Rspress supports not only Markdown but also [MDX](https://mdxjs.com/), a powerful way to develop content.
4
+
5
+ ## Markdown
6
+
7
+ MDX is a superset of Markdown, which means you can write Markdown files as usual. For example:
8
+
9
+ ```md
10
+ # Hello world
11
+ ```
12
+
13
+ ## Use components
14
+
15
+ When you want to use React components in Markdown files, you should name your files with `.mdx` extension.
16
+
17
+ ```mdx
18
+ // docs/index.mdx
19
+ import { CustomComponent } from './custom';
20
+
21
+ # Hello world
22
+
23
+ <CustomComponent />
24
+ ```
25
+
26
+ ## Use Rspress built-in components
27
+
28
+ import { Tabs, Tab } from '@rspress/core/theme';
29
+
30
+ <Tabs>
31
+
32
+ <Tab label="foo.js">
33
+
34
+ ```js
35
+ console.log('foo');
36
+ ```
37
+
38
+ </Tab>
39
+ <Tab label="bar.js">
40
+
41
+ ```js
42
+ console.log('bar');
43
+ ```
44
+
45
+ </Tab>
46
+
47
+ </Tabs>
@@ -0,0 +1,33 @@
1
+ # Container
2
+
3
+ You can use the `:::` syntax to create custom containers and support custom titles.
4
+
5
+ ## Examples
6
+
7
+ :::tip
8
+ This is a `block` of type `tip`
9
+ :::
10
+
11
+ :::info
12
+ This is a `block` of type `info`
13
+ :::
14
+
15
+ :::warning
16
+ This is a `block` of type `warning`
17
+ :::
18
+
19
+ :::danger
20
+ This is a `block` of type `danger`
21
+ :::
22
+
23
+ ::: details
24
+ This is a `block` of type `details`
25
+ :::
26
+
27
+ :::tip Custom Title
28
+ This is a `block` of `Custom Title`
29
+ :::
30
+
31
+ :::tip{title="Custom Title"}
32
+ This is a `block` of `Custom Title`
33
+ :::
@@ -0,0 +1,43 @@
1
+ ---
2
+ pageType: home
3
+
4
+ hero:
5
+ name: My Site
6
+ text: A cool website!
7
+ tagline: This is the tagline
8
+ actions:
9
+ - theme: brand
10
+ text: Quick Start
11
+ link: /guide/start/introduction
12
+ - theme: alt
13
+ text: GitHub
14
+ link: https://github.com/web-infra-dev/rspress
15
+ image:
16
+ src: /rspress-icon.png
17
+ alt: Logo
18
+ features:
19
+ - title: Blazing fast build speed
20
+ details: The core compilation module is based on the Rust front-end toolchain, providing a more ultimate development experience.
21
+ icon: 🏃🏻‍♀️
22
+ link: /guide/start/introduction
23
+ - title: Support for MDX content writing
24
+ details: MDX is a powerful way to write content, allowing you to use React components in Markdown.
25
+ icon: 📦
26
+ link: /guide/use-mdx/components
27
+ - title: Built-in full-text search
28
+ details: Automatically generates a full-text search index for you during construction, providing out-of-the-box full-text search capabilities.
29
+ icon: 🎨
30
+ link: https://rspress.rs/guide/advanced/custom-search
31
+ - title: AI-friendly
32
+ details: Generate llms.txt and Markdown files compliant with the llms.txt specification through SSG-MD, making it easier for large language models to understand and use your documentation.
33
+ icon: 🤖
34
+ link: https://rspress.rs/guide/basic/ssg-md
35
+ - title: Static site generation
36
+ details: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
37
+ icon: 🌈
38
+ link: https://rspress.rs/guide/basic/ssg
39
+ - title: Providing multiple custom capabilities
40
+ details: Through its extension mechanism, you can easily extend theme UI and build process.
41
+ icon: 🔥
42
+ link: https://rspress.rs/guide/basic/custom-theme
43
+ ---
@@ -0,0 +1,12 @@
1
+ /* Example brand color overrides for the custom theme scaffold. */
2
+ /* For more CSS variables, see https://rspress.rs/ui/vars. */
3
+ :root {
4
+ --rp-c-brand: #ff5e00;
5
+ --rp-c-brand-dark: #ff704d;
6
+ --rp-c-brand-darker: #ff704d;
7
+ --rp-c-brand-light: #ff7524;
8
+ --rp-c-brand-lighter: #ff7524;
9
+ --rp-c-brand-tint: rgba(255, 94, 0, 0.07);
10
+
11
+ --rp-home-hero-secondary-color: #ff5e00;
12
+ }
@@ -0,0 +1,4 @@
1
+ // Learn how to customize the theme: https://rspress.rs/guide/basic/custom-theme
2
+ import './index.css';
3
+
4
+ export * from '@rspress/core/theme-original';
@@ -9,11 +9,11 @@
9
9
  "preview": "rspress preview"
10
10
  },
11
11
  "dependencies": {
12
- "@rspress/core": "^2.0.11"
12
+ "@rspress/core": "^2.0.13"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^22.8.1",
16
- "@types/react": "^19.2.14",
16
+ "@types/react": "^19.2.15",
17
17
  "@types/react-dom": "^19.2.3",
18
18
  "react": "^19.2.6",
19
19
  "react-dom": "^19.2.6"
@@ -3,6 +3,7 @@ import { defineConfig } from '@rspress/core';
3
3
 
4
4
  export default defineConfig({
5
5
  root: path.join(__dirname, 'docs'),
6
+ lang: 'en',
6
7
  title: 'My Site',
7
8
  icon: '/rspress-icon.png',
8
9
  logo: {
@@ -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": "Document",
14
+ "link": "https://rspress.rs/"
15
+ }
16
+ ]
@@ -0,0 +1 @@
1
+ ["index", "commands"]
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Command reference for Rspress development, production build, and local preview scripts.
3
+ ---
4
+
5
+ # Commands
6
+
7
+ ## dev
8
+
9
+ ## build
10
+
11
+ ## preview
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: API Overview
3
+ description: Overview page for the Rspress starter API section and available reference pages.
4
+ overview: true
5
+ ---
6
+
7
+ This is an API Overview page which outlines all the available APIs.
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "dir-section-header",
4
+ "name": "start",
5
+ "label": "Getting Started"
6
+ },
7
+ {
8
+ "type": "dir-section-header",
9
+ "name": "use-mdx",
10
+ "label": "Markdown & MDX"
11
+ }
12
+ ]
@@ -0,0 +1 @@
1
+ ["introduction", "getting-started"]
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Set up an Rspress project, run local development, build production output, and choose next docs topics.
3
+ ---
4
+
5
+ # Getting started
6
+
7
+ ## Project structure
8
+
9
+ After creating a project with `create-rspress`, you will get the following project structure:
10
+
11
+ - `docs/` — The documentation source directory, configured via `root` in `rspress.config.ts`.
12
+ - `docs/_nav.json` — The navigation bar configuration.
13
+ - `docs/guide/_meta.json` — The sidebar configuration for the guide section.
14
+ - `docs/public/` — Static assets directory.
15
+ - `theme/` — Optional custom theme directory, generated when you choose the custom theme scaffold.
16
+ - `rspress.config.ts` — The Rspress configuration file.
17
+
18
+ ## Development
19
+
20
+ Start the local development server:
21
+
22
+ ```bash
23
+ npm run dev
24
+ ```
25
+
26
+ :::tip
27
+
28
+ You can specify the port number or host with `--port` or `--host`, such as `rspress dev --port 8080 --host 0.0.0.0`.
29
+
30
+ :::
31
+
32
+ ## Production build
33
+
34
+ Build the site for production:
35
+
36
+ ```bash
37
+ npm run build
38
+ ```
39
+
40
+ By default, Rspress will output to `doc_build` directory.
41
+
42
+ ## Preview
43
+
44
+ Preview the production build locally:
45
+
46
+ ```bash
47
+ npm run preview
48
+ ```
49
+
50
+ ## Next steps
51
+
52
+ - Learn how to use [MDX & React Components](/guide/use-mdx/components) in your docs.
53
+ - Learn about [Code Blocks](/guide/use-mdx/code-blocks/) syntax highlighting and line highlighting.
54
+ - Learn about [Custom Containers](/guide/use-mdx/container) for tips, warnings, and more.
55
+ - Explore the full [Rspress documentation](https://rspress.rs/) for advanced features.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Introduction to Rspress features, including build performance, AI-native output, MDX, and extensibility.
3
+ ---
4
+
5
+ # Introduction
6
+
7
+ Rspress is a static site generator based on [Rsbuild](https://rsbuild.rs/), rendered with the React framework. It comes with a default documentation theme, and you can quickly build a documentation site with Rspress.
8
+
9
+ ## Why Rspress
10
+
11
+ - **Build Performance**. The core compilation module is based on the Rust front-end toolchain, providing millisecond-level startup and a more ultimate development experience.
12
+ - **AI-native**. Technical documentation not only serves human readers but can also be better understood and utilized by AI through SSG-MD.
13
+ - **MDX Support**. MDX is a powerful way to write content, allowing you to use React components in Markdown.
14
+ - **Basic Capabilities**. Including full-text search, internationalization, multi-version support, component library documentation, etc.
15
+ - **Extensibility**. Provides a built-in plugin system, supports extending Rspress through plugin API.
16
+
17
+ ## Try Rspress
18
+
19
+ Go to [Getting Started](/guide/start/getting-started) to learn how to use Rspress to build a documentation site.
@@ -0,0 +1 @@
1
+ ["components", { "type": "dir", "name": "code-blocks" }, "container"]
@@ -0,0 +1 @@
1
+ ["title", "meta"]
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: Configure Rspress code blocks with Shiki syntax highlighting and automatic language handling.
3
+ ---
4
+
5
+ # Code blocks
6
+
7
+ Rspress uses [Shiki](https://shiki.style) for syntax highlighting at compile time, which means better runtime performance.
8
+
9
+ When using code blocks in multiple languages, the corresponding language is automatically detected at compile time, and the runtime bundle size does not increase. For supported programming languages, refer to the [Shiki supported languages list](https://shiki.style/languages).
10
+
11
+ ```js
12
+ console.log('Hello World');
13
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Add metadata such as line numbers, wrapping, and titles to Rspress code blocks.
3
+ ---
4
+
5
+ # Meta
6
+
7
+ Besides the title, we also have some other meta attributes.
8
+
9
+ ```ts lineNumbers wrapCode title="example.ts"
10
+ const longLine = 'This code block has line numbers, code wrapping, and a title';
11
+ ```
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Add file titles to Rspress code blocks using Markdown code fence metadata.
3
+ ---
4
+
5
+ # Title
6
+
7
+ ```js title="foo.js"
8
+ console.log('Hello World');
9
+ ```