Skip to content

docs: fix all 158 broken links #5972

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
Mar 20, 2025

Conversation

kisaragi-hiu
Copy link
Contributor

@kisaragi-hiu kisaragi-hiu commented Mar 20, 2025

Right now (2025-03-21T00:14:25+0900) there are a lot of broken links in the TanStack Table documentation. This PR should fix every single one of them.

Should obsolete #5965, #5934, #5918 and fix #5947 if merged.

How

I listed the broken links on my end like this:

# utilizing lychee
# lychee doesn't support checking links recursively from a web page;
# but we do have a kind of sitemap here that we can pass to it.
cd tanstack-table/docs/
lychee $(find . -name '*.md' | sed 's~./~https://tanstack.com/table/latest/docs/~;s/.md//')
# for the local build; might also want `--timeout 60`
lychee $(find . -name '*.md' | sed 's~./~http://localhost:3000/table/latest/docs/~;s/.md//')
# sed's separator in 's/from/to/' can be changed to avoid escaping,
# so 's~from~to~' has the same effect except slashes can stay as-is.
# then s/.md// gets rid of the extension, completing the conversion
# to deployed URLs.
# (I'm explaining all this because I'm also scared by the xz takeover.)

Notes

There is some magic with relative links: "../" seems to navigate to "../../" instead (???), while ./ is the current path. As a result every replacement here is manually done and tested with lychee. Exceptional cases are explained in the details section below.

I haven't checked whether this is an issue with just TanStack Table docs, or if it's a thing that should be fixed in tanstack.com. I still decided to make this fix (and this PR) because there has already been prior PRs that adapt links to this form.

When checking the result afterwards, there may be one broken link left if locally only the /tanstack/tanstack.com and /tanstack/table repositories are checked out:
from localhost:3000/table/latest/docs/guide/virtualization, linking to localhost:3000/virtual/v3/docs/api/virtualizer. This is an artifact of the way it's checked out, and the link target actually exists if the TanStack Virtual docs are present.

Detailed changes

  • docs/api/core/{cell,column,header-group,header,row,table}:

    The link to /docs/guide/features currently link to /guide/features
    instead, and causes a redirect loop.

    This error is deployed right now: check eg.
    https://tanstack.com/table/latest/docs/api/core/cell
    and click the "table features" link.

    (This is not exceptional, just the first case I tackled.)

  • docs/guide/headers:

    Aside from fixing paths, also fix an incorrect reference to
    non-existant Column Resizing Guide at docs/guide/column-resizing;
    presumably this is misspelling for the Column Sizing Guide at
    docs/guide/column-sizing.

  • docs/guide/row-selection

    Beyond fixing paths, also fix a missing /example/ in the vue example
    path.

Would obsolete TanStack#5965, TanStack#5918 if merged.

I listed the broken links on my end like this:

    # utilizing lychee
    # lychee doesn't support checking links recursively from a web page;
    # but we do have a kind of sitemap here that we can pass to it.
    cd tanstack-table/docs/
    lychee $(find . -name '*.md' | sed 's~./~https://tanstack.com/table/latest/docs/~;s/.md//')
    # for the local build; might also want `--timeout 60`
    lychee $(find . -name '*.md' | sed 's~./~http://localhost:3000/table/latest/docs/~;s/.md//')
    # sed's separator in 's/from/to/' can be changed to avoid escaping,
    # so 's~from~to~' has the same effect except slashes can stay as-is.
    # then s/.md// gets rid of the extension, completing the conversion
    # to deployed URLs.
    # (I'm explaining all this because I'm also scared by the xz takeover.)

There is some magic with relative links: "../" seems to navigate to
"../../" instead (???), while ./ is the current path. As a result every
replacement here is manually done and tested with lychee. Exceptional
cases are explained in the details section below.

When checking the result afterwards, there may be one broken link left
if locally only the /tanstack/tanstack.com and /tanstack/table
repositories are checked out:
from localhost:3000/table/latest/docs/guide/virtualization,
linking to localhost:3000/virtual/v3/docs/api/virtualizer.
This is an artifact of the way it's checked out.

Detailed changes:

docs/api/core/{cell,column,header-group,header,row,table}:
  link to /docs/guide/features currently link to /guide/features
  instead, and causes a redirect loop.
  This error is deployed right now: check eg.
  https://tanstack.com/table/latest/docs/api/core/cell
  and click the "table features" link.
  (This is not exceptional, just the first case I tackled.)

docs/guide/headers:
  Aside from fixing paths, also fix an incorrect reference to
  non-existant Column Resizing Guide at docs/guide/column-resizing;
  presumably this is misspelling for the Column Sizing Guide at
  docs/guide/column-sizing.

docs/guide/row-selection:
  Beyond fixing paths, also fix a missing /example/ in the vue example
  path.
@KevinVandy KevinVandy merged commit f7bf6f1 into TanStack:main Mar 20, 2025
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.

Docs - All intra-documentation links broken
2 participants