Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 30, 2025

close IDP-1215

Summary by CodeRabbit

  • New Features

    • Added support for exporting individual documentation entries as separate PDF files, with configuration options for custom naming and entry selection.
    • UI now provides localized links to view specific documentation sections as PDF, with improved sidebar detection for context-aware PDF links.
  • Documentation

    • Updated English and Chinese docs with new sections and examples explaining PDF export configuration.
    • Enhanced clarity, consistency, and detail across configuration and getting started guides.
    • Added references and examples for new export functionality.
  • Bug Fixes

    • Improved PDF export process with better temporary file cleanup and error handling.
  • Refactor

    • Streamlined PDF export logic and improved internal structure for easier maintenance and extension.
  • Style

    • Minor formatting and capitalization improvements in documentation and UI text.
  • Tests

    • Updated configuration fixtures to demonstrate new export capabilities.

@JounQin JounQin self-assigned this Jun 30, 2025
Copilot AI review requested due to automatic review settings June 30, 2025 05:17
@JounQin JounQin added enhancement New feature or request feature labels Jun 30, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: e858007

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

This PR includes changesets to release 1 package
Name Type
@alauda/doom Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

Walkthrough

This update introduces support for exporting individual documentation entries as PDF files, configurable via new export settings. Documentation in both English and Chinese is updated to explain the new export options. The CLI and core PDF generation logic are refactored to handle partial exports, and the theme is enhanced to provide PDF links for specific documentation sections.

Changes

Files / Group Change Summary
.changeset/spicy-glasses-own.md Added changeset documenting the new feature: single entry PDF export support for @alauda/doom.
docs/en/start.mdx, docs/en/usage/configuration.md, docs/zh/start.mdx, docs/zh/usage/configuration.md Editorial improvements and added documentation for new export configuration options, including references and configuration examples for exporting PDFs by entry.
fixture-docs/doom.config.yml Added export section with entries for partial PDF export examples.
src/cli/export-pdf-core/generatePdf.ts Extended PDF generation options and logic to support exporting by entry, conditional temp directory cleanup, and returning outlines.
src/cli/export-pdf-core/utils/mergePDF.ts Refactored path handling, improved error handling, and minor code cleanup.
src/cli/export.ts Refactored export logic to support exporting multiple named entries, improved temp file management, and enhanced logging.
src/cli/load-config.ts Expanded glob patterns in export entries to explicit file lists using tinyglobby.
src/global/VersionsNav/index.tsx Updated PDF download link construction to use withBase utility.
src/plugins/global/index.ts Added export property to global virtual module for runtime access.
src/runtime/translation.ts Added translation key for "View full docs as PDF" in multiple languages.
src/theme.tsx Refactored and extended theme: added logic to display PDF links for specific documentation sections and improved search component.
src/types.ts Added ExportItem interface and extended user config to support new export options.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant ConfigLoader
    participant PDFGenerator
    participant FileSystem

    User->>CLI: Run export command
    CLI->>ConfigLoader: Load config (with export entries)
    ConfigLoader->>CLI: Return config with expanded export entries
    CLI->>PDFGenerator: For each export entry, generate PDF
    PDFGenerator->>FileSystem: Read entry files
    PDFGenerator->>FileSystem: Write generated PDFs
    CLI->>FileSystem: Cleanup temp directory
    CLI->>User: Output exported PDF paths
Loading

Suggested labels

documentation

Poem

In the warren where docs abound,
Now each entry can be PDF-bound!
With config set and globs in play,
Export your guides the rabbit way.
Hop through sections, print with glee—
A burrow of knowledge, now PDF!
🐇📄✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/cli/load-config.ts

Oops! Something went wrong! :(

ESLint: 9.30.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

src/cli/export-pdf-core/generatePdf.ts

Oops! Something went wrong! :(

ESLint: 9.30.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

src/runtime/translation.ts

Oops! Something went wrong! :(

ESLint: 9.30.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

  • 6 others
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • 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 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 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for exporting a single entry as a PDF by introducing a new ExportItem interface and integrating export configuration into multiple parts of the codebase, including CLI commands, theme layout, and documentation.

  • Adds ExportItem type and export property to user configuration
  • Updates the theme layout and sidebar logic to utilize the new export settings
  • Enhances CLI and PDF generation logic to support custom PDF export functionality

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Added ExportItem type and updated configuration interfaces
src/theme.tsx Modified sidebar resolution using virtual.export and layout logic
src/runtime/translation.ts Added new translation keys for PDF export
src/plugins/global/index.ts Integrated export property to global plugin options
src/global/VersionsNav/index.tsx Adjusted PDF link composition for version navigation
src/cli/load-config.ts Normalized export entries using globSync
src/cli/export.ts Updated export command with new exportEntries and custom PDF naming
src/cli/export-pdf-core/utils/mergePDF.ts Refactored path joining and error handling in PDF merging
src/cli/export-pdf-core/generatePdf.ts Added cleanupTempDir and outline mapping options in PDF generation
fixture-docs/doom.config.yml Added sample configuration entries for PDF export
docs/zh/usage/configuration.md, etc. Updated documentation to cover the new PDF export configuration
Comments suppressed due to low confidence (2)

src/cli/load-config.ts:354

  • The 'entry' property of ExportItem is defined as a string or string[], however globSync is called with item.entry directly. Consider normalizing the value (e.g. converting an array to a comma-separated string or mapping over each string) to ensure correct glob matching.
    export: config.export?.map((item) => ({

src/theme.tsx:29

  • [nitpick] Consider renaming 'getClosestSidebar_' to a more descriptive identifier, such as 'findMatchingSidebar', to improve readability and clarify its purpose.
const getClosestSidebar_ = (

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 30, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@100.tgz

commit: e858007

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/theme.tsx (1)

59-68: Add null check before iterating over virtual.export.

The non-null assertion on virtual.export! could cause runtime errors if the export configuration is undefined.

 const getClosestSidebar = (sidebarItems: DoomSidebar[], pathname: string) => {
-  for (const item of virtual.export!) {
+  if (!virtual.export) {
+    return
+  }
+  for (const item of virtual.export) {
     const found = getClosestSidebar_(
       sidebarItems,
       pathname,
       item.entry as string[],
     )
     if (found) {
       return {
         sidebar: found,
         exportItem: item,
       }
     }
   }
 }
🧹 Nitpick comments (2)
.changeset/spicy-glasses-own.md (1)

5-5: Consider minor grammar improvement.

The description is clear, but could be slightly improved for better grammar.

Consider this minor revision:

-feat: support export single entry as PDF
+feat: support exporting single entry as PDF
docs/en/start.mdx (1)

178-178: Fix grammatical issue with "otherwise".

The word "otherwise" is an adverb and shouldn't be used as a conjunction. Consider rephrasing for better grammar.

-- The `-g, --glob` parameter is required and can specify the directories or paths of files to translate, supporting `glob` syntax. Note that the parameter value must be quoted, otherwise it may be parsed unexpectedly by the command line. Examples:
+- The `-g, --glob` parameter is required and can specify the directories or paths of files to translate, supporting `glob` syntax. Note that the parameter value must be quoted; otherwise, it may be parsed unexpectedly by the command line. Examples:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11f67c0 and acca9fa.

📒 Files selected for processing (15)
  • .changeset/spicy-glasses-own.md (1 hunks)
  • docs/en/start.mdx (9 hunks)
  • docs/en/usage/configuration.md (10 hunks)
  • docs/zh/start.mdx (1 hunks)
  • docs/zh/usage/configuration.md (1 hunks)
  • fixture-docs/doom.config.yml (1 hunks)
  • src/cli/export-pdf-core/generatePdf.ts (4 hunks)
  • src/cli/export-pdf-core/utils/mergePDF.ts (3 hunks)
  • src/cli/export.ts (4 hunks)
  • src/cli/load-config.ts (3 hunks)
  • src/global/VersionsNav/index.tsx (2 hunks)
  • src/plugins/global/index.ts (3 hunks)
  • src/runtime/translation.ts (3 hunks)
  • src/theme.tsx (1 hunks)
  • src/types.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
.changeset/spicy-glasses-own.md (1)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
src/plugins/global/index.ts (4)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
src/global/VersionsNav/index.tsx (3)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
docs/zh/usage/configuration.md (1)
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
fixture-docs/doom.config.yml (1)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
docs/en/start.mdx (6)
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#34
File: src/theme.tsx:4-17
Timestamp: 2025-05-29T10:21:32.682Z
Learning: In the @alauda/doom project, environment variables like ALGOLIA_APP_ID, ALGOLIA_API_KEY, and ALGOLIA_INDEX_NAME are injected at build time, making non-null assertions safe when used after truthiness checks.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
src/cli/load-config.ts (3)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#9
File: src/cli/load-config.ts:27-27
Timestamp: 2025-05-12T11:11:41.048Z
Learning: The yoctocolors package is used in the codebase for colored terminal output, with the cyan function imported in src/cli/load-config.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/cli/export-pdf-core/utils/mergePDF.ts (1)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
src/types.ts (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
src/cli/export.ts (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#9
File: src/cli/load-config.ts:27-27
Timestamp: 2025-05-12T11:11:41.048Z
Learning: The yoctocolors package is used in the codebase for colored terminal output, with the cyan function imported in src/cli/load-config.ts.
docs/en/usage/configuration.md (5)
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Learnt from: JounQin
PR: alauda/doom#34
File: src/theme.tsx:4-17
Timestamp: 2025-05-29T10:21:32.682Z
Learning: In the @alauda/doom project, environment variables like ALGOLIA_APP_ID, ALGOLIA_API_KEY, and ALGOLIA_INDEX_NAME are injected at build time, making non-null assertions safe when used after truthiness checks.
src/theme.tsx (3)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
🧬 Code Graph Analysis (2)
src/global/VersionsNav/index.tsx (1)
src/shared/helpers.ts (1)
  • getPdfName (7-8)
src/cli/export-pdf-core/generatePdf.ts (6)
src/cli/export-pdf-core/utils/mergePDF.ts (1)
  • PDFOutline (28-28)
src/cli/export-pdf-core/utils/getUrlLink.ts (1)
  • getUrlLink (1-7)
src/cli/html-export-pdf/utils/cliProgress.ts (1)
  • createProgress (8-90)
src/cli/html-export-pdf/core/printer.ts (1)
  • Printer (43-326)
src/cli/html-export-pdf/utils/isValidUrl.ts (1)
  • isValidUrl (1-3)
src/cli/html-export-pdf/utils/fs.ts (1)
  • writeFileSafe (8-23)
🪛 LanguageTool
.changeset/spicy-glasses-own.md

[uncategorized] ~5-~5: This verb may not be in the correct form. Consider using a different form for this context.
Context: ...@alauda/doom": minor --- feat: support export single entry as PDF

(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)

docs/en/start.mdx

[uncategorized] ~153-~153: A punctuation mark might be missing here.
Context: ...eview. ### Using Scaffolding Templates {#new} Run yarn new to generate projects, ...

(AI_EN_LECTOR_MISSING_PUNCTUATION)


[typographical] ~178-~178: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: .... Note that the parameter value must be quoted, otherwise it may be parsed unexpectedly by the co...

(THUS_SENTENCE)

docs/en/usage/configuration.md

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...# Basic Configuration {#basic} - lang: Default documentation language. To acco...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ... set to null or undefined. - title: Documentation title, displayed on the b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ..., displayed on the browser tab. - logo: Logo at the top left of the documentati...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ...lt into the doom package. - logoText: Documentation title displayed next to t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...xt to the logo at the top left. - icon: Documentation favicon, defaults to the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...defaults to the same as logo. - base: Base path of the documentation, used wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ...oduct-docs. Defaults to /. - outDir`: Output directory for build artifacts. D...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~85-~85: Loose punctuation mark.
Context: ...e ``` ### frontmatterMode - `ignore`: Ignore the frontmatter of the reference...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~86-~86: Loose punctuation mark.
Context: ...urrent document's frontmatter. - merge: Merge the frontmatter of the referenced...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~87-~87: Loose punctuation mark.
Context: ...ride the current document's. - replace: Replace the current document's frontmat...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
🔇 Additional comments (18)
src/runtime/translation.ts (1)

19-19: LGTM! Translation key added consistently across all languages.

The new view_docs_as_pdf translation key has been properly added to all three supported languages with appropriate translations that accurately convey the intended meaning.

Also applies to: 42-42, 63-63

src/types.ts (2)

52-57: Well-designed interface for export configuration.

The ExportItem interface provides a clean and flexible API with appropriate optional properties and support for both single and multiple entries.


76-76: Export configuration properly integrated into UserConfig.

The addition of the optional export property follows the existing pattern and maintains backward compatibility.

docs/zh/start.mdx (1)

240-240: Documentation reference properly added.

The link to the export configuration documentation provides users with easy access to detailed configuration options for the new PDF export feature.

src/global/VersionsNav/index.tsx (2)

6-6: Good import optimizations.

Adding withBase import and converting NavItem to a type import are both good practices that improve code clarity and potentially bundle size.

Also applies to: 8-8


61-62: Improved PDF link construction with proper base URL handling.

Using withBase() instead of manual string concatenation ensures proper base URL handling and follows RSPress framework conventions. The dependency array update is also correct since withBase handles the base URL internally.

src/plugins/global/index.ts (1)

7-7: LGTM! Clean integration of export configuration into the global virtual module.

The changes correctly extend the virtual module system to expose export configuration data to the runtime environment, following established patterns in the codebase.

Also applies to: 22-22, 70-70

fixture-docs/doom.config.yml (1)

9-13: Good example configuration for the new export feature.

The export entries provide clear examples of how to configure named PDF exports using glob patterns, which will be useful for testing and demonstrating the feature.

docs/zh/usage/configuration.md (1)

237-246: Excellent documentation for the new export feature.

The documentation clearly explains the export configuration with a practical example, making it easy for users to understand and implement the feature.

src/cli/export-pdf-core/utils/mergePDF.ts (3)

186-189: Improved error handling approach.

Throwing an Error instead of writing to stderr and calling process.exit is a better approach for composability and testability.


2-2: Clean import refactoring.

The path import consolidation and removal of unused imports improves code readability.

Also applies to: 196-196, 212-212


177-177: Approve path resolution change

The switch to path.resolve(outDir) is safe—relative paths still resolve against process.cwd(), and absolute paths are now correctly respected (unlike the previous path.join(process.cwd(), outDir) behavior). No breaking changes detected.

All other refactorings (error handling, import cleanup) look good. LGTM.

src/cli/load-config.ts (3)

31-31: Appropriate dependency for glob pattern expansion.

The tinyglobby import provides the necessary functionality to expand glob patterns in export configurations.


354-357: Correct implementation of glob pattern expansion.

The export configuration processing correctly expands glob patterns to file lists using the local base path as the working directory, which aligns with the documented behavior.


484-484: Ensures processed export configuration is included in final config.

The explicit assignment ensures that the glob-expanded export entries are properly included in the merged configuration.

src/cli/export-pdf-core/generatePdf.ts (1)

29-31: Well-designed extension for multi-PDF export support.

The changes elegantly support both single and multiple PDF exports:

  • Optional allOutlines parameter enables outline reuse across exports
  • Conditional cleanupTempDir allows deferring cleanup when exporting multiple PDFs
  • Return type includes outlines for consistency across exports

The implementation correctly handles both code paths with appropriate conditional logic.

Also applies to: 49-50, 84-147, 159-163

src/cli/export.ts (1)

27-43: Excellent implementation of single entry PDF export.

The refactoring effectively supports the new export feature:

  • collectPages extraction improves code organization
  • findEntryFactory provides robust recursive search for sidebar entries
  • exportEntries properly handles missing entries with clear warnings
  • PDF outline sharing between exports ensures consistent bookmarks
  • Deferred temp directory cleanup allows multiple export operations

The error handling and user feedback are well implemented.

Also applies to: 141-184, 191-200

docs/en/usage/configuration.md (1)

238-246: Clear documentation for the new export feature.

The export configuration section effectively documents the new single entry PDF export capability with:

  • Clear explanation of the feature
  • Well-structured YAML example
  • Proper description of configuration options

@JounQin JounQin force-pushed the feat/export_single_entry branch from acca9fa to e858007 Compare June 30, 2025 05:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/theme.tsx (1)

77-77: Address potential runtime safety issue with non-null assertion.

Using a non-null assertion (virtual.export!) can be risky if virtual.export is ever undefined.

Consider adding an explicit nullish check before iterating:

-  for (const item of virtual.export!) {
+  if (virtual.export) {
+    for (const item of virtual.export) {
🧹 Nitpick comments (1)
.changeset/spicy-glasses-own.md (1)

5-5: Fix grammatical error in the changeset description.

The phrase "support export single entry" is grammatically incorrect.

Apply this diff to fix the grammar:

-feat: support export single entry as PDF
+feat: support exporting single entry as PDF
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between acca9fa and e858007.

📒 Files selected for processing (15)
  • .changeset/spicy-glasses-own.md (1 hunks)
  • docs/en/start.mdx (9 hunks)
  • docs/en/usage/configuration.md (10 hunks)
  • docs/zh/start.mdx (1 hunks)
  • docs/zh/usage/configuration.md (1 hunks)
  • fixture-docs/doom.config.yml (1 hunks)
  • src/cli/export-pdf-core/generatePdf.ts (4 hunks)
  • src/cli/export-pdf-core/utils/mergePDF.ts (3 hunks)
  • src/cli/export.ts (4 hunks)
  • src/cli/load-config.ts (3 hunks)
  • src/global/VersionsNav/index.tsx (2 hunks)
  • src/plugins/global/index.ts (3 hunks)
  • src/runtime/translation.ts (3 hunks)
  • src/theme.tsx (1 hunks)
  • src/types.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • docs/zh/start.mdx
  • src/runtime/translation.ts
  • docs/zh/usage/configuration.md
  • src/global/VersionsNav/index.tsx
  • src/cli/load-config.ts
  • src/plugins/global/index.ts
  • src/types.ts
  • fixture-docs/doom.config.yml
  • src/cli/export-pdf-core/utils/mergePDF.ts
  • src/cli/export-pdf-core/generatePdf.ts
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
src/theme.tsx (3)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T08:59:41.491Z
Learning: In @rspress/core v2.0.0-beta.7, the '/theme' export is available in the package exports field as `"./theme": { "default": "./theme.ts" }`, so imports like `import { Badge, Button } from '@rspress/core/theme'` are valid even if ESLint shows resolution errors.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
src/cli/export.ts (2)
Learnt from: JounQin
PR: alauda/doom#40
File: src/plugins/sitemap/index.ts:7-7
Timestamp: 2025-05-29T16:25:28.086Z
Learning: In @rspress/shared v2.0.0-beta.8, the '/logger' export is available in the package exports field, so imports like `import { logger } from '@rspress/shared/logger'` are valid even if ESLint shows resolution errors. This is used throughout the codebase in files like src/cli/translate.ts, src/cli/load-config.ts, src/utils/git.ts, and src/plugins/sitemap/index.ts.
Learnt from: JounQin
PR: alauda/doom#9
File: src/cli/load-config.ts:27-27
Timestamp: 2025-05-12T11:11:41.048Z
Learning: The yoctocolors package is used in the codebase for colored terminal output, with the cyan function imported in src/cli/load-config.ts.
.changeset/spicy-glasses-own.md (1)
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
docs/en/start.mdx (6)
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: JounQin has mentioned multiple times that the alauda/doom project uses yarn v4, and there are no ESLint import resolution errors for @rspress/core subpath imports.
Learnt from: JounQin
PR: alauda/doom#34
File: src/theme.tsx:4-17
Timestamp: 2025-05-29T10:21:32.682Z
Learning: In the @alauda/doom project, environment variables like ALGOLIA_APP_ID, ALGOLIA_API_KEY, and ALGOLIA_INDEX_NAME are injected at build time, making non-null assertions safe when used after truthiness checks.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
docs/en/usage/configuration.md (5)
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:23:34.965Z
Learning: In the @alauda/doom project, JounQin prefers concise error handling over verbose validation. While they prefer throwing on invalid configuration rather than graceful fallbacks, they don't want overly detailed validation with multiple explicit checks and error messages.
Learnt from: JounQin
PR: alauda/doom#34
File: src/cli/load-config.ts:290-0
Timestamp: 2025-05-29T10:22:30.004Z
Learning: In the @alauda/doom project, the team prefers throwing descriptive errors for invalid configuration rather than using optional chaining or graceful fallbacks. This fail-fast approach helps catch configuration issues early during development.
Learnt from: JounQin
PR: alauda/doom#30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `@rspress/core/theme` work without any ESLint errors.
Learnt from: JounQin
PR: alauda/doom#75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.
Learnt from: JounQin
PR: alauda/doom#34
File: src/theme.tsx:4-17
Timestamp: 2025-05-29T10:21:32.682Z
Learning: In the @alauda/doom project, environment variables like ALGOLIA_APP_ID, ALGOLIA_API_KEY, and ALGOLIA_INDEX_NAME are injected at build time, making non-null assertions safe when used after truthiness checks.
🧬 Code Graph Analysis (1)
src/theme.tsx (4)
src/runtime/components/_X.tsx (1)
  • X (3-3)
src/plugins/auto-sidebar/walk.ts (3)
  • DoomSidebarGroup (35-38)
  • DoomSidebarItem (25-27)
  • DoomSidebar (29-33)
src/types.ts (1)
  • ExportItem (52-57)
src/runtime/hooks/useTranslation.ts (2)
  • useLang (7-7)
  • useTranslation (9-16)
🪛 LanguageTool
.changeset/spicy-glasses-own.md

[uncategorized] ~5-~5: This verb may not be in the correct form. Consider using a different form for this context.
Context: ...@alauda/doom": minor --- feat: support export single entry as PDF

(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)

docs/en/start.mdx

[uncategorized] ~153-~153: A punctuation mark might be missing here.
Context: ...eview. ### Using Scaffolding Templates {#new} Run yarn new to generate projects, ...

(AI_EN_LECTOR_MISSING_PUNCTUATION)


[typographical] ~178-~178: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: .... Note that the parameter value must be quoted, otherwise it may be parsed unexpectedly by the co...

(THUS_SENTENCE)

docs/en/usage/configuration.md

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...# Basic Configuration {#basic} - lang: Default documentation language. To acco...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ... set to null or undefined. - title: Documentation title, displayed on the b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ..., displayed on the browser tab. - logo: Logo at the top left of the documentati...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ...lt into the doom package. - logoText: Documentation title displayed next to t...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...xt to the logo at the top left. - icon: Documentation favicon, defaults to the ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...defaults to the same as logo. - base: Base path of the documentation, used wh...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ...oduct-docs. Defaults to /. - outDir`: Output directory for build artifacts. D...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~85-~85: Loose punctuation mark.
Context: ...e ``` ### frontmatterMode - `ignore`: Ignore the frontmatter of the reference...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~86-~86: Loose punctuation mark.
Context: ...urrent document's frontmatter. - merge: Merge the frontmatter of the referenced...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~87-~87: Loose punctuation mark.
Context: ...ride the current document's. - replace: Replace the current document's frontmat...

(UNLIKELY_OPENING_PUNCTUATION)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 18 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
🔇 Additional comments (4)
docs/en/start.mdx (1)

15-287: LGTM! Excellent documentation improvements.

The editorial changes significantly improve clarity and consistency throughout the documentation. The references to the new export configuration feature align well with the PR objectives.

src/cli/export.ts (1)

27-204: Excellent refactoring for multi-entry PDF export support.

The implementation effectively separates concerns with well-designed helper functions:

  • collectPages for page collection with configurable base paths
  • findEntryFactory for recursive sidebar entry lookup
  • exportEntries for coordinated multi-export processing

The error handling with warnings for missing entries and proper cleanup of temporary directories shows good attention to detail.

docs/en/usage/configuration.md (1)

238-247: Comprehensive documentation for the new export feature.

The export configuration section provides clear examples and proper context for users. The documentation aligns well with the implementation and follows the established documentation patterns.

src/theme.tsx (1)

30-143: Well-designed theme integration for PDF export functionality.

The implementation elegantly handles:

  • Recursive sidebar traversal with proper depth tracking
  • Locale-aware sidebar matching
  • Dynamic PDF link generation based on export configuration
  • Clean separation of concerns between matching logic and UI rendering

The MatchedSidebar interface and related functions provide a solid foundation for contextual PDF links.

@JounQin JounQin merged commit 7454e96 into main Jun 30, 2025
16 checks passed
@JounQin JounQin deleted the feat/export_single_entry branch June 30, 2025 05:42
github-actions bot pushed a commit that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants