Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Runtime hook documentation was monolithic under api-runtime; split and polished per-hook docs in both English and Chinese, now living under ui/hooks for easier discovery.

  • Docs structure
    • Added dedicated pages for usePageData, useLang, useVersion, useDark, and router hooks under website/docs/*/ui/hooks.
    • Updated _meta.json ordering for new hook pages.
  • Runtime API overview
    • Converted api-runtime pages to an overview linking to the new hook docs.
    • Refreshed cross-references in plugin system intro to point to usePageData docs.
import { usePageData } from '@rspress/core/runtime';

export default function PageTitle() {
  const { page } = usePageData();
  return <h1>{page.title}</h1>;
}
Original prompt

修改文档

根据 docs/en/api/client-api/api-runtime,将这几个 react hooks 拆分为多个文档放在 website/docs/en/ui/hooks 下,并每篇文档润色

中英文都进行修改


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 03d9034
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/693bf3083acd940008bba9b8
😎 Deploy Preview https://deploy-preview-2885--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link

CLAassistant commented Dec 12, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ SoonIter
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Update documentation for React hooks in multiple files Split runtime hook docs into dedicated UI hook pages Dec 12, 2025
Copilot AI requested a review from SoonIter December 12, 2025 09:48
@SoonIter SoonIter force-pushed the copilot/split-react-hooks-docs branch from e86e826 to 86c28db Compare December 12, 2025 10:43
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

Rsdoctor Bundle Diff Analysis

📁 web

Path: website/doc_build/web/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 14.5 MB - -
📄 JavaScript 13.9 MB - -
🎨 CSS 113.7 KB - -
🌐 HTML 0 B - -
📁 Other Assets 477.0 KB - -

Generated by Rsdoctor GitHub Action

@SoonIter SoonIter changed the title Split runtime hook docs into dedicated UI hook pages docs: Split runtime hook docs into dedicated UI hook pages Dec 12, 2025
@SoonIter SoonIter marked this pull request as ready for review December 12, 2025 10:47
Copilot AI review requested due to automatic review settings December 12, 2025 10:47
@SoonIter SoonIter enabled auto-merge (squash) December 12, 2025 10:49
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 restructures the runtime hook documentation by splitting a monolithic API reference into dedicated, polished pages for each hook in both English and Chinese. The documentation is now organized under ui/hooks for improved discoverability.

  • Split runtime hooks into individual documentation pages (usePageData, useLang, useVersion, useDark, router hooks)
  • Updated all cross-references throughout the documentation to point to the new hook locations
  • Removed the old api/client-api directory structure and integrated hooks into the UI section

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/docs/{en,zh}/ui/hooks/use-version.mdx New dedicated page documenting the useVersion hook for multi-version documentation support
website/docs/{en,zh}/ui/hooks/use-page-data.mdx New page for usePageData hook, marked as deprecated with enhanced usage examples
website/docs/{en,zh}/ui/hooks/use-lang.mdx New page documenting useLang hook for locale management with live preview example
website/docs/{en,zh}/ui/hooks/use-dark.mdx New page for useDark hook with SSG/hydration warnings and CSS selector guidance
website/docs/{en,zh}/ui/hooks/router-hooks.mdx New page documenting re-exported React Router hooks
website/docs/{en,zh}/ui/hooks/index.mdx Overview page for the hooks section
website/docs/{en,zh}/ui/hooks/_meta.json Updated navigation metadata to include all new hook pages in proper order
website/docs/{en,zh}/ui/custom-theme.mdx Updated Runtime API reference link to point to new hooks location
website/docs/{en,zh}/ui/components/package-manager-tabs.mdx Added frontmatter with tag: ejectable and updated component imports
website/docs/{en,zh}/plugin/system/introduction.mdx Updated usePageData reference to new documentation path
website/docs/{en,zh}/plugin/official-plugins/algolia.mdx Updated Runtime API link to new hooks overview page
website/docs/{en,zh}/api/client-api/api-runtime.mdx Removed old monolithic runtime API documentation
website/docs/{en,zh}/api/client-api/api-components.mdx Removed old components API page
website/docs/{en,zh}/api/client-api/_meta.json Removed client-api directory metadata
website/docs/{en,zh}/api/_meta.json Removed client-api directory entry from API navigation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoonIter SoonIter merged commit 5d394d4 into main Dec 12, 2025
8 of 9 checks passed
@SoonIter SoonIter deleted the copilot/split-react-hooks-docs branch December 12, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants