Skip to content

docs: add guide for edit docs and preview in local #5005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2025

Conversation

leesb971204
Copy link
Contributor

@leesb971204 leesb971204 commented Aug 21, 2025

Recently, while working on several docs update, I felt uneasy because I couldn’t find a good way to confirm that the changes were being applied correctly.
I found some relevant docs in the tanstack/query repository, and I thought it would be useful to add it here as well — so I went ahead and made that update.

Summary by CodeRabbit

  • Documentation
    • Expanded contributor guide for editing and previewing docs locally, with step-by-step setup, shallow clone tip, install/run commands, and local preview URL.
    • Clarifies that docs are hosted on the website and that production builds fetch content from GitHub.
    • Notes when to update documentation configuration when adding new pages.
    • Adds a directory structure example, command snippets, and a screenshot reference to streamline the local docs workflow.

Signed-off-by: leesb971204 <leesb971204@gmail.com>
Copy link

coderabbitai bot commented Aug 21, 2025

Walkthrough

Updates CONTRIBUTING.md to replace a brief docs note with a detailed local workflow for editing and previewing TanStack/router docs using the tanstack.com site. Adds cloning instructions, directory structure, dev server commands, preview URL, and notes about production docs fetching and config updates for new pages.

Changes

Cohort / File(s) Summary of Changes
Docs contribution workflow update
CONTRIBUTING.md
Rewrote the “Changes to the docs” section to provide step-by-step local preview setup using tanstack.com, including repo layout, shallow clone guidance, pnpm commands, preview URL structure, linkage to ../router/docs, notes on production fetching from GitHub, and config update reminders for new pages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A nibble of notes, a hop through dev lands,
I cloned two burrows with careful paws and plans.
pnpm spins, the preview springs to view—
Docs nibble fresh greens, linked paths true.
In configs I twitch my whiskered glance,
Then thump approval—commit, advance! 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

nx-cloud bot commented Aug 21, 2025

View your CI Pipeline Execution ↗ for commit 7d3b690

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-21 04:56:02 UTC

Copy link

pkg-pr-new bot commented Aug 21, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5005

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5005

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5005

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5005

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5005

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5005

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5005

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5005

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5005

@tanstack/react-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@5005

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5005

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5005

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5005

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5005

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5005

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5005

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5005

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5005

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5005

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5005

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5005

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5005

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5005

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5005

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5005

@tanstack/solid-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@5005

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5005

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5005

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5005

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5005

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@5005

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@5005

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@5005

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5005

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5005

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5005

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5005

commit: 7d3b690

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: 1

🧹 Nitpick comments (6)
CONTRIBUTING.md (6)

26-31: Tighten wording, fix grammar, and format links in the new docs section.

  • “The documentations” → “Documentation”.
  • Prefer Markdown links over bare URLs.
  • Clarify sibling-repo requirement and format paths as code.
- - Editing the docs locally and previewing the changes
-  - The documentations for all the TanStack projects are hosted on [tanstack.com](https://tanstack.com), which is a TanStack Start application (https://github.com/TanStack/tanstack.com). You need to run this app locally to preview your changes in the `TanStack/router` docs.
+ - Editing the docs locally and previewing the changes
+  - Documentation for all TanStack projects is hosted on [tanstack.com](https://tanstack.com), a TanStack Start application ([TanStack/tanstack.com](https://github.com/TanStack/tanstack.com)). To preview your `TanStack/router` docs changes locally, run the site alongside this repository.
 
 > [!NOTE]
-> The website fetches the doc pages from GitHub in production, and searches for them at `../router/docs` in development. Your local clone of `TanStack/router` needs to be in the same directory as the local clone of `TanStack/tanstack.com`.
+> In production the website fetches doc pages from GitHub. In development it looks for them at `../router/docs` relative to the `tanstack.com` repo. Ensure your local clones of `TanStack/router` and `TanStack/tanstack.com` are sibling directories.

34-51: Unify clone approach and offer HTTPS/GH alternatives to avoid SSH friction.

Earlier guidance uses gh repo clone, while this section switches to git clone via SSH. Propose consistent options and keep shallow-clone note.

-2. Enter that directory and clone the [`TanStack/router`](https://github.com/TanStack/router) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos.
+2. Enter that directory and clone the [`TanStack/router`](https://github.com/TanStack/router) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos.
 
 ```sh
 cd tanstack
-git clone git@github.com:TanStack/router.git
-# We probably don't need all the branches and commit history
-# from the `tanstack.com` repo, so let's just create a shallow
-# clone of the latest version of the `main` branch.
-# Read more about shallow clones here:
-# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones
-git clone git@github.com:TanStack/tanstack.com.git --depth=1 --single-branch --branch=main
+# Option A (GitHub CLI)
+gh repo clone TanStack/router
+# Shallow clone the site repo to speed things up:
+gh repo clone TanStack/tanstack.com -- --depth=1 --single-branch --branch=main
+
+# Option B (HTTPS)
+# git clone https://github.com/TanStack/router.git
+# git clone https://github.com/TanStack/tanstack.com.git --depth=1 --single-branch --branch=main
+
+# Learn more about shallow clones:
+# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones

53-63: Specify a language for the directory tree code fence and clarify the naming constraint.

Adds a language identifier to satisfy MD040 and briefly explains why “router” must be the folder name.

 > Your `tanstack` directory should look like this:
 >
-> ```
+> ```text
 > tanstack/
 >    |
->    +-- router/ (<-- this directory cannot be called anything else!)
+>    +-- router/  # must be named exactly "router" because tanstack.com resolves ../router/docs in dev
 >    |
 >    +-- tanstack.com/
 > ```

64-71: Use consistent install command and verify the dev server protocol (http vs https).

  • Earlier you use pnpm install; here it’s pnpm i. Pick one for consistency.
  • The comment says “https://localhost:3000 by default,” but the example below uses http. Most dev servers default to http. Please confirm and align both lines.
 cd tanstack.com
-pnpm i
-# The app will run on https://localhost:3000 by default
+pnpm install
+# The app will run on http://localhost:3000 by default
 pnpm dev

To verify, run the dev server and confirm whether it serves on HTTP or HTTPS by default, then update both this comment and the preview URL below to match.


73-74: Linkify the preview URL and consider a version placeholder.

  • Replace the bare URL with a Markdown link to satisfy MD034.
  • If versioning changes, “latest” may vary. Consider noting that you can swap “latest” with a specific version.
-4. Now you can visit http://localhost:3000/router/latest/docs/framework/react/overview in the browser and see the changes you make in `tanstack/router/docs` there.
+4. Now visit [http://localhost:3000/router/latest/docs/framework/react/overview](http://localhost:3000/router/latest/docs/framework/react/overview) to preview changes made under `tanstack/router/docs`.  
+   Tip: Replace `latest` with a specific version if needed.

Please verify the exact path segment (e.g., framework/react/overview) matches the current docs structure.


80-80: Avoid bare URL for the screen capture and provide descriptive text.

Converts the bare link to a labeled Markdown link to satisfy MD034 and improve accessibility.

-https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b
+[Screen capture: local docs preview workflow](https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b)
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f05c0b and 7d3b690.

📒 Files selected for processing (1)
  • CONTRIBUTING.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md

[grammar] ~29-~29: There might be a mistake here.
Context: ...n the TanStack/router docs. > [!NOTE] > The website fetches the doc pages from...

(QB_NEW_EN)


[grammar] ~53-~53: There might be a mistake here.
Context: ...ngle-branch --branch=main ``` > [!NOTE] > Your tanstack directory should look ...

(QB_NEW_EN)


[grammar] ~75-~75: There might be a mistake here.
Context: ...nstack/router/docsthere. > [!WARNING] > You will need to update thedocs/(rou...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

27-27: Bare URL used

(MD034, no-bare-urls)


56-56: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


73-73: Bare URL used

(MD034, no-bare-urls)


80-80: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Preview

Comment on lines +75 to +77
> [!WARNING]
> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Disambiguate the config file path for new pages.

docs/(router or start)config.json” is unclear within this repo. Please name the exact file(s) to edit, e.g., docs/router.config.json. Use the script below to verify actual config files present.

-> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
+> If you add a new documentation page, update the appropriate docs config file (e.g., `docs/router.config.json`) in `TanStack/router`.

🏁 Script executed:

#!/bin/bash
# Locate likely docs config files to mention precisely in CONTRIBUTING.md
fd -t f '.config.json' docs -0 | xargs -0 -I {} echo "Found: {}"
rg -nP --glob 'docs/**' '(config\.json|\.config\.json)' -S

Length of output: 3713


🏁 Script executed:

#!/bin/bash
# Locate all docs directories
find . -type d -iname docs

# List JSON files directly under any docs directory
find . -type f -path "*/docs/*.json"

# Find any files ending with "config.json" anywhere in the repo
find . -type f -iname '*config.json'

Length of output: 8612


Clarify docs config file path in CONTRIBUTING.md

The placeholder docs/(router or start)config.json is ambiguous. Replace it with the exact paths to the two existing config files in the docs directory:

  • docs/router/config.json
  • docs/start/config.json

Update CONTRIBUTING.md at lines 75–77 accordingly:

> [!WARNING]
- You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
+ If you add a new documentation page, update the appropriate config file in the `docs` directory:
+ - `docs/router/config.json` (for Router docs)
+ - `docs/start/config.json`  (for Start docs)
📝 Committable suggestion

‼️ 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.

Suggested change
> [!WARNING]
> You will need to update the `docs/(router or start)config.json` file (in `TanStack/router`) if you add a new documentation page!
> [!WARNING]
> If you add a new documentation page, update the appropriate config file in the `docs` directory:
> - `docs/router/config.json` (for Router docs)
> - `docs/start/config.json` (for Start docs)
🧰 Tools
🪛 LanguageTool

[grammar] ~75-~75: There might be a mistake here.
Context: ...nstack/router/docsthere. > [!WARNING] > You will need to update thedocs/(rou...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 75 to 77, the docs config path text is
ambiguous; replace the placeholder `docs/(router or start)config.json` with the
two exact config file paths `docs/router/config.json` and
`docs/start/config.json` so contributors know the precise files to update; edit
the line to list both paths separated clearly (e.g., bullet or comma) and ensure
formatting matches surrounding Markdown.

@schiller-manuel schiller-manuel merged commit 8134650 into TanStack:main Aug 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants