Repository: alauda/doom
Pull request #21: feat: add `onlyIncludeRoutes` config support
Author: login: JounQin
Labels: name: enhancement
description: New feature or request
name: feature
Created: 2025-05-19T05:53:06Z | Merged: 2025-05-19T06:08:01Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added support for a new configuration option to selectively include specific documentation routes when using the CLI ignore option, enabling more granular control over which routes are included or excluded.
  - Set OpenAI translation output temperature to zero for more consistent results.

- **Documentation**
  - Updated English and Chinese documentation to explain the new configuration option and provide improved examples and clarifications for route inclusion and exclusion settings.

- **Chores**
  - Updated example configuration files to demonstrate usage of the new selective route inclusion feature.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.changeset/fresh-zoos-sip.md b/.changeset/fresh-zoos-sip.md
new file mode 100644
index 00000000..769f802f
--- /dev/null
+++ b/.changeset/fresh-zoos-sip.md
@@ -0,0 +1,5 @@
+---
+"@alauda/doom": patch
+---
+
+chore: enable `temperature: 0` for openai output stability
diff --git a/.changeset/young-snails-join.md b/.changeset/young-snails-join.md
new file mode 100644
index 00000000..9b00da04
--- /dev/null
+++ b/.changeset/young-snails-join.md
@@ -0,0 +1,5 @@
+---
+"@alauda/doom": patch
+---
+
+feat: add `onlyIncludeRoutes` config support
diff --git a/docs/en/usage/configuration.md b/docs/en/usage/configuration.md
index 9678c0ae..0fff1443 100644
--- a/docs/en/usage/configuration.md
+++ b/docs/en/usage/configuration.md
@@ -1,7 +1,7 @@
 ---
 description: Configure `doom` documentation tool
 weight: 1
-sourceSHA: e06d0647311a571bc2a3584ed125b83d6f6ab016738b27879f59aa32984fdd92
+sourceSHA: 11ecf257d004e931c672a3eeda41c811f327c91c61fba6625cbb858736213033
 ---
 
 # Configuration {#configuration}
@@ -20,7 +20,7 @@ export default defineConfig({})
 
 ## Basic Configuration {#basic}
 
-- `lang`: The default document language. For the convenience of the majority of projects, we support both Chinese and English documents by default, with the default language set to `en`. If the current document project does not require multilingual support, this can be set to `null` or `undefined`.
+- `lang`: The default document language. To accommodate most projects, we support both Chinese and English documents by default, with the default language set to `en`. If the current document project does not require multilingual support, this can be set to `null` or `undefined`.
 - `title`: The document title, which will appear in the browser tab.
 - `logo`: The logo in the top left corner of the document. It supports image links and file paths; absolute paths reference files in the `public` directory, while relative paths refer to files relative to the current tool directory. By default, it uses the built-in Alauda logo from the `doom` package.
 - `logoText`: The document title that will display at the logo location in the top left corner.
@@ -94,7 +94,7 @@ For writing documentation, refer to [reference documentation](./reference).
 ```yaml
 releaseNotes:
   queryTemplates:
-    fixed: # may include jql statements with ejs templates.
+    fixed: # May include jql statements with ejs templates.
     unfixed:
 ```
 
@@ -115,20 +115,29 @@ sidebar:
   collapsed: false # Optional, whether to default the left navigation to be collapsed. Defaults to collapsed. If there is not much document content, it can be set to false.
 ```
 
-## Internal Document Routes {#internal-routes}
+## Internal Document Routes Configuration {#internal-routes}
 
 ```yaml
 internalRoutes: # Optional, supports glob matching, relative to the docs directory. Matched files will be ignored if the cli is enabled with the `-i, --ignore` option.
   - '*/internal/**/*'
 ```
 
+## Only Include Document Routes Configuration {#only-include-routes}
+
+```yaml
+onlyIncludeRoutes: # Optional, supports glob matching, relative to the docs directory. Only routes/files under this configuration will be activated when the cli is enabled with the `-i, --ignore` option. Can be used in conjunction with `internalRoutes` to further exclude some routes within.
+  - '*/internal/**/*'
+internalRoutes:
+  - '*/internal/overview.mdx'
+```
+
 ## Language Highlight Plugin Configuration {#highlight}
 
 ```yaml
 shiki:
-  theme: # optional, https://shiki.style/themes
-  langs: # optional, https://shiki.style/languages
-  transformers: # optional, only available in js/ts config, https://shiki.style/guide/transformers
+  theme: # Optional, https://shiki.style/themes
+  langs: # Optional, https://shiki.style/languages
+  transformers: # Optional, only available in js/ts config, https://shiki.style/guide/transformers
 ```
 
 :::warning
diff --git a/docs/zh/usage/configuration.md b/docs/zh/usage/configuration.md
index b91a91b8..5d8049e0 100644
--- a/docs/zh/usage/configuration.md
+++ b/docs/zh/usage/configuration.md
@@ -114,11 +114,20 @@ sidebar:
   collapsed: false # 可选，是否默认折叠左导航，默认折叠，文档内容不多时可以考虑设置为 false
 ```
 
-## 内部文档路由 \{#internal-routes}
+## 内部文档路由配置 \{#internal-routes}
 
 ```yaml
-internalRoutes: # 可选，支持 glob 匹配，相对于 docs 目录，匹配到的文件在 cli 启用 `-i, --ignore` 选项时会被忽略
-  - '*/internal/**/*'
+internalRoutes: # 可选，支持 glob 匹配，相对于 docs 目录，在 cli 启用 `-i, --ignore` 选项时匹配到的路由/文件会被忽略
+  - '*/internal/**'
+```
+
+## 仅包含文档路由配置 \{#only-include-routes}
+
+```yaml
+onlyIncludeRoutes: # 可选，支持 glob 匹配，相对于 docs 目录，在 cli 启用 `-i, --ignore` 选项时只有此配置下的路由/文件会被启用，可同时配合 `internalRoutes` 进一步排除其中的部分路由
+  - '*/internal/**'
+internalRoutes:
+  - '*/internal/overview.mdx'
 ```
 
 ## 语言高亮插件配置 \{#highlight}
diff --git a/fixture-docs/doom.config.yml b/fixture-docs/doom.config.yml
index ecac7f29..d81e9397 100644
--- a/fixture-docs/doom.config.yml
+++ b/fixture-docs/doom.config.yml
@@ -42,7 +42,10 @@ releaseNotes:
       AND ReleaseNotesStatus = Publish
       AND project = <%= project %>
     unfixed: ''
+onlyIncludeRoutes:
+  - '*/install/**'
 internalRoutes:
+  - '*/install/prerequisites.mdx'
   - '*/internal/*.mdx'
   - '*/concepts/**'
 editRepoBaseUrl: alauda/doom/tree/main/fixture-docs
diff --git a/src/cli/load-config.ts b/src/cli/load-config.ts
index 602165e1..27e4a7b2 100644
--- a/src/cli/load-config.ts
+++ b/src/cli/load-config.ts
@@ -211,6 +211,7 @@ const getCommonConfig = async ({
     lang: fallbackToZh ? 'zh' : config.lang || 'en',
     title: '',
     route: {
+      include: ignore ? config.onlyIncludeRoutes : undefined,
       exclude: [
         'dist/**/*',
         'public/**/*',
@@ -218,6 +219,7 @@ const getCommonConfig = async ({
         'doom.config.*',
         '**/assets/**/*',
         '**/*.d.ts',
+        ...((ignore && config.internalRoutes) || []),
         ...unusedLanguages.map((lang) => `${lang}/**/*`),
       ],
     },
diff --git a/src/cli/translate.ts b/src/cli/translate.ts
index da798922..09998111 100644
--- a/src/cli/translate.ts
+++ b/src/cli/translate.ts
@@ -167,6 +167,7 @@ export const translate = async ({
       },
     ],
     model: 'gpt-4o-mini',
+    temperature: 0,
   })
 
   const { content, refusal } = choices[0].message
diff --git a/src/plugins/auto-sidebar/index.ts b/src/plugins/auto-sidebar/index.ts
index 99adba46..cd7eb143 100644
--- a/src/plugins/auto-sidebar/index.ts
+++ b/src/plugins/auto-sidebar/index.ts
@@ -168,6 +168,7 @@ function processLocales(
   defaultLang: string,
   defaultVersion: string,
   extensions: string[],
+  onlyIncludeRoutes?: string[],
   excludeRoutes?: string[],
   collapsed?: boolean,
 ) {
@@ -186,6 +187,7 @@ function processLocales(
                 routePrefix,
                 root,
                 extensions,
+                onlyIncludeRoutes,
                 excludeRoutes,
                 collapsed,
               )
@@ -197,6 +199,7 @@ function processLocales(
               addTrailingSlash(lang === defaultLang ? '' : `/${lang}`),
               root,
               extensions,
+              onlyIncludeRoutes,
               excludeRoutes,
               collapsed,
             ),
@@ -218,6 +221,7 @@ export const autoSidebar = async (
   config: UserConfig,
   { ignore, export: export_ }: AutoSidebarPluginOptions,
 ) => {
+  const onlyIncludeRoutes = (ignore && config.onlyIncludeRoutes) || []
   const excludeRoutes = (ignore && config.internalRoutes) || []
   const route = (config.route ??= {})
   if (export_ || excludeRoutes.length) {
@@ -246,6 +250,7 @@ export const autoSidebar = async (
       defaultLang,
       defaultVersion,
       extensions,
+      onlyIncludeRoutes,
       excludeRoutes,
       collapsed,
     )
@@ -267,12 +272,23 @@ export const autoSidebar = async (
               routePrefix,
               config.root!,
               extensions,
+              onlyIncludeRoutes,
               excludeRoutes,
               collapsed,
             )
           }),
         )
-      : [await walk(root, '/', root, extensions, excludeRoutes, collapsed)]
+      : [
+          await walk(
+            root,
+            '/',
+            root,
+            extensions,
+            onlyIncludeRoutes,
+            excludeRoutes,
+            collapsed,
+          ),
+        ]
 
     const combined = combineWalkResult(walks, versions)
 
diff --git a/src/plugins/auto-sidebar/walk.ts b/src/plugins/auto-sidebar/walk.ts
index 2798e541..b393c332 100644
--- a/src/plugins/auto-sidebar/walk.ts
+++ b/src/plugins/auto-sidebar/walk.ts
@@ -50,6 +50,7 @@ const sidebarSorter = (a: DoomSidebar, b: DoomSidebar) => {
 const processSideMeta = (
   sideMeta: Array<DoomSidebar | undefined>,
   extensions: string[],
+  onlyIncludeRoutes: string[],
   excludeRoutes: string[],
 ) => {
   const result = sideMeta.reduce<{
@@ -66,9 +67,15 @@ const processSideMeta = (
         return acc
       }
 
-      const ignored = excludeRoutes.some((glob) =>
-        picomatch.isMatch(curr._fileKey!, glob),
-      )
+      const included =
+        !onlyIncludeRoutes.length ||
+        onlyIncludeRoutes.some((glob) =>
+          picomatch.isMatch(curr._fileKey!, glob),
+        )
+
+      const excluded =
+        !included ||
+        excludeRoutes.some((glob) => picomatch.isMatch(curr._fileKey!, glob))
 
       let filePart: string | undefined
 
@@ -91,7 +98,7 @@ const processSideMeta = (
         } else {
           acc.index = curr
         }
-        if (ignored) {
+        if (excluded) {
           if (acc.index === curr) {
             curr.link = ''
             if (acc.others.length === 0) {
@@ -104,7 +111,7 @@ const processSideMeta = (
             }
           }
         }
-      } else if (!ignored) {
+      } else if (!excluded) {
         acc.others.push(curr)
       }
 
@@ -125,6 +132,7 @@ export async function scanSideMeta(
   routePrefix: string,
   extensions: string[],
   ignoredDirs: string[],
+  onlyIncludeRoutes: string[],
   excludeRoutes: string[],
 ) {
   if (!(await pathExists(workDir))) {
@@ -267,6 +275,7 @@ export async function scanSideMeta(
           routePrefix,
           extensions,
           ['assets'],
+          onlyIncludeRoutes,
           excludeRoutes,
         )
         const realPath = await detectFilePath(subDir, extensions)
@@ -313,7 +322,12 @@ export async function scanSideMeta(
     }),
   )
 
-  return processSideMeta(sidebarFromMeta, extensions, excludeRoutes)
+  return processSideMeta(
+    sidebarFromMeta,
+    extensions,
+    onlyIncludeRoutes,
+    excludeRoutes,
+  )
 }
 
 // Start walking from the doc directory, scan the `_meta.json` file in each subdirectory
@@ -323,6 +337,7 @@ export async function walk(
   routePrefix = '/',
   docsDir: string,
   extensions: string[],
+  onlyIncludeRoutes: string[] = [],
   excludeRoutes: string[] = [],
   collapsed?: boolean,
 ) {
@@ -333,6 +348,7 @@ export async function walk(
     routePrefix,
     extensions,
     ['assets', 'public', 'shared'],
+    onlyIncludeRoutes,
     excludeRoutes,
   )
 
diff --git a/src/types.ts b/src/types.ts
index b5dde70b..d6ef71ff 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -52,6 +52,7 @@ declare module '@rspress/shared' {
     reference?: ReferenceItem[]
     sidebar?: Omit<AutoSidebarPluginOptions, 'download' | 'excludeRoutes'>
     releaseNotes?: ReleaseNotesOptions
+    onlyIncludeRoutes?: string[]
     internalRoutes?: string[]
     translate?: TranslateOptions
     shiki?: PluginShikiOptions


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR adds support for a new configuration option, onlyIncludeRoutes, to control which routes are enabled for documentation generation. Key changes include:
- Introducing an onlyIncludeRoutes property to the shared configuration types.
- Propagating onlyIncludeRoutes through the auto sidebar logic (walk, scanSideMeta, and processSideMeta).
- Updating CLI configuration and both Chinese and English documentation to reflect the new option.

### Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

<details>
<summary>Show a summary per file</summary>

| File                                   | Description                                                    |
| -------------------------------------- | -------------------------------------------------------------- |
| src/types.ts                           | Added the onlyIncludeRoutes property in the shared types.      |
| src/plugins/auto-sidebar/walk.ts         | Updated logic to filter routes using onlyIncludeRoutes along with excludeRoutes. |
| src/plugins/auto-sidebar/index.ts         | Propagated the onlyIncludeRoutes option through autoSidebar processing. |
| src/cli/load-config.ts                 | Mapped onlyIncludeRoutes in CLI configuration.                 |
| fixture-docs/doom.config.yml            | Demonstrated onlyIncludeRoutes usage in sample configuration.    |
| docs/zh/usage/configuration.md         | Updated documentation to include onlyIncludeRoutes description.  |
| docs/en/usage/configuration.md         | Updated documentation to include onlyIncludeRoutes description.  |
</details>



<details>
<summary>Comments suppressed due to low confidence (2)</summary>

**src/plugins/auto-sidebar/walk.ts:70**
* Consider adding an inline comment here to explain that a route is automatically included when no onlyIncludeRoutes filter is provided, or if it matches one of the provided glob patterns.
```
const included = !onlyIncludeRoutes.length || onlyIncludeRoutes.some((glob) => picomatch.isMatch(curr._fileKey!, glob))
```
**src/plugins/auto-sidebar/walk.ts:76**
* Consider adding an inline comment that clarifies the compound condition for exclusion based on both the onlyIncludeRoutes and excludeRoutes filters.
```
const excluded = !included || excludeRoutes.some((glob) => picomatch.isMatch(curr._fileKey!, glob))
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:53:32Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>

<details>
<summary>.changeset/young-snails-join.md (1)</summary><blockquote>

`5-5`: **Remove redundant `feat:` prefix in the changeset summary**  
Changeset summaries are typically plain descriptions rather than commit-type headings. The `feat:` prefix follows commit conventions but isn't required in this context.  
  
Consider updating to:
```diff
-feat: add `onlyIncludeRoutes` config support
+Add `onlyIncludeRoutes` config support
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**
**Cache: Disabled due to data retention organization setting**
**Knowledge Base: Disabled due to data retention organization setting**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 2498d6b0f51784db9dbf2ba090a2f0b699993882 and 2f5eac359599ac284f7347470b5e68b933c85e65.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `.changeset/fresh-zoos-sip.md` (1 hunks)
* `.changeset/young-snails-join.md` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* .changeset/fresh-zoos-sip.md

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (2)</summary>

* GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
* GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-19T06:06:11Z
user: login: JounQin
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-19T06:07:01Z
user: login: coderabbitai[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-19T06:07:42Z

Review comments:
diff_hunk: @@ -218,6 +221,7 @@ export const autoSidebar = async (
   config: UserConfig,
   { ignore, export: export_ }: AutoSidebarPluginOptions,
 ) => {
+  const onlyIncludeRoutes = (ignore && config.onlyIncludeRoutes) || []
path: src/plugins/auto-sidebar/index.ts
user: login: Copilot
body: [nitpick] The usage of the ignore flag to conditionally assign onlyIncludeRoutes might be confusing; consider documenting or revisiting this flow if the behavior is intended to differ from internalRoutes.
created_at: 2025-05-19T05:53:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -211,13 +211,15 @@ const getCommonConfig = async ({
     lang: fallbackToZh ? 'zh' : config.lang || 'en',
     title: '',
     route: {
+      include: ignore ? config.onlyIncludeRoutes : undefined,
path: src/cli/load-config.ts
user: login: Copilot
body: [nitpick] Consider adding a comment to explain how onlyIncludeRoutes is utilized when the ignore flag is active, to help future maintainers understand the configuration mapping.
created_at: 2025-05-19T05:53:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,5 @@
+---
+"@alauda/doom": patch
+---
path: .changeset/young-snails-join.md
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Semver bump level should be `minor` for a new feature**  
The change introduces a new public configuration option (`onlyIncludeRoutes`), which adds functionality. According to semver, adding features requires a **minor** version bump, not a patch.  
  
Please update the frontmatter to:
```diff
---
- "@alauda/doom": patch
+ "@alauda/doom": minor
---
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
---
"@alauda/doom": minor
---
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In the .changeset/young-snails-join.md file at lines 1 to 3, the semver bump
level is incorrectly set to patch for a new feature addition. Change the version
bump from patch to minor in the frontmatter to correctly reflect the addition of
the new public configuration option `onlyIncludeRoutes`.
```

</details>

<!-- This is an auto-generated reply by CodeRabbit -->
created_at: 2025-05-19T06:06:10Z
author_association: NONE
diff_hunk: @@ -0,0 +1,5 @@
+---
+"@alauda/doom": patch
+---
path: .changeset/young-snails-join.md
user: login: JounQin
body: It's in pre 1.0, so patch is for feature.
created_at: 2025-05-19T06:07:01Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,5 @@
+---
+"@alauda/doom": patch
+---
path: .changeset/young-snails-join.md
user: login: coderabbitai[bot]
body: <details>
<summary>🧩 Analysis chain</summary>

🏁 Script executed:
```
#!/bin/bash
# Check the current version of @alauda/doom
grep -r "\"version\":" --include="package.json" .
```

Length of output: 204

---



</details>

@JounQin You're absolutely correct. For pre-1.0 versions (I see the package is currently at 0.23.2), the semver conventions are more relaxed, and using a patch version for new features is a common and valid approach since the API is still considered in development. Thanks for the clarification!


<!-- <agentComponentType>chat-answer</agentComponentType> -->

<!-- <rawResChunk><answer><details>
<summary>🧩 Analysis chain</summary>

🏁 Script executed:
```
#!/bin/bash
# Check the current version of @alauda/doom
grep -r "\"version\":" --include="package.json" .
```

Length of output: 204

---



</details>

@JounQin You're absolutely correct. For pre-1.0 versions (I see the package is currently at 0.23.2), the semver conventions are more relaxed, and using a patch version for new features is a common and valid approach since the API is still considered in development. Thanks for the clarification!</answer></rawResChunk> -->

<!-- This is an auto-generated reply by CodeRabbit -->
created_at: 2025-05-19T06:07:42Z
author_association: NONE

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-05-19T05:53:10Z
body: ###  🦋  Changeset detected

Latest commit: 2f5eac359599ac284f7347470b5e68b933c85e65

**The changes in this PR will be included in the next version bump.**

<details><summary>This PR includes changesets to release 1 package</summary>

  | Name         | Type  |
| ------------ | ----- |
| @alauda/doom | Patch |

</details>

Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/alauda/doom/new/feat/onlyIncludeRoutes?filename=.changeset/light-jars-pretend.md&value=---%0A%22%40alauda%2Fdoom%22%3A%20patch%0A---%0A%0Afeat%3A%20add%20%60onlyIncludeRoutes%60%20config%20support%0A)


author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-05-19T05:53:13Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

A new configuration option, `onlyIncludeRoutes`, was introduced to allow explicit inclusion of documentation routes, complementing the existing `internalRoutes` exclusion mechanism. Documentation in both English and Chinese was updated to describe this feature, and related CLI and sidebar plugin logic were modified to support combined inclusion and exclusion of routes when the ignore flag is enabled. Additionally, the OpenAI translation request was updated to fix the temperature parameter to zero for deterministic output.

## Changes

| File(s)                                                                                  | Change Summary                                                                                                                                                                                                                                                                                                                                                                                                |
|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| docs/en/usage/configuration.md<br>docs/zh/usage/configuration.md                        | Updated documentation to clarify and expand on the configuration of internal document routes, renamed relevant section titles, added and explained the new `onlyIncludeRoutes` option with examples, and refined existing examples and comments.                                                                                                                        |
| fixture-docs/doom.config.yml                                                            | Added `onlyIncludeRoutes` key with a route pattern and prepended a route to the `internalRoutes` list to demonstrate new configuration options.                                                                                                                                                                                                                        |
| src/types.ts                                                                            | Added an optional `onlyIncludeRoutes?: string[]` property to the `UserConfig` interface in the `@rspress/shared` module declaration.                                                                                                                                                                                                                                   |
| src/cli/load-config.ts                                                                  | Modified the configuration loading logic to include the `onlyIncludeRoutes` and updated how `exclude` and `include` route arrays are set based on the `ignore` flag.                                                                                                                                                                                                  |
| src/plugins/auto-sidebar/index.ts                                                       | Updated `processLocales` and `autoSidebar` to accept and propagate the new `onlyIncludeRoutes` parameter, ensuring it is passed to all relevant functions when the ignore flag is set.                                                                                                                                                                                |
| src/plugins/auto-sidebar/walk.ts                                                        | Updated the signatures and logic of `processSideMeta`, `scanSideMeta`, and `walk` to support the new `onlyIncludeRoutes` parameter. Implemented combined inclusion and exclusion filtering for sidebar generation based on both `onlyIncludeRoutes` and `excludeRoutes`.                                                                                              |
| src/cli/translate.ts                                                                    | Added a fixed `temperature: 0` parameter to the OpenAI chat completion request to ensure deterministic translation output.                                                                                                                                                                                                                                            |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant CLI
    participant ConfigLoader
    participant SidebarPlugin

    User->>CLI: Run with --ignore flag
    CLI->>ConfigLoader: Load configuration
    ConfigLoader->>ConfigLoader: Set onlyIncludeRoutes and internalRoutes
    ConfigLoader->>SidebarPlugin: Pass include/exclude routes
    SidebarPlugin->>SidebarPlugin: Generate sidebar with inclusion/exclusion logic
    SidebarPlugin-->>CLI: Sidebar structure
    CLI-->>User: Output with filtered routes
```

## Poem

> 🥕  
> A rabbit hops through docs anew,  
> With routes to pick, both old and true.  
> "Include these only!"—now we say,  
> And skip the rest along the way.  
> Sidebar paths, so neat and bright—  
> Our warren’s mapped just right tonight!  
>

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AzEtS5pa9AAb4MF2QEkMDC9iUAJXw8aRcFDBt4IkhEbG5ufApcAwA5bGYBS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yaL8zEPW76FkIW62SW221C4NRxp6N26Nb22o/29NYO4TpAO2ljgelNZozCvIJiyjFI9agevm5fEp3ZsgCp0E28MsNCtuZsGu3sKVIcFwKcJy1LLcDdLMI8AsC8IYO51WOoAAPoSSIAxcDh9IzJ0AxeFrPsNAGDucADsAAHLQNl2gGcwAMzFdoDFckBnMACsAAbDYLQAAJxFc2C5cMDFcMACBnO5d5AkBVd5AlcCAMBVfLHFfZcRdZdNCQA5BnMNf5c1cCCFM2B9d5dnO0ACANdrc2A5BfaFMNeFNoA5A2CFMCA1cNdncNfFe5e5c5DjfueHdVf2BtdVcNfPdNcMA5C5dnM2DZfFdnPZd/fHcPc1e5frelcMC5dA9VfjcTcQD7BYpxe0AJdJf9KpctARdAA== -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=alauda/doom&utm_content=21):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: pkg-pr-new[bot]
created_at: 2025-05-19T05:53:57Z
body: 
[Open in StackBlitz](https://pkg.pr.new/template/35845bd0-9e29-4158-b132-1b40b50d1f1e)


```
npm i https://pkg.pr.new/@alauda/doom@21
```


_commit: <a href="https://github.com/alauda/doom/runs/42453498531"><code>2f5eac3</code></a>_

author_association: NONE