Skip to content

Commit 464ae26

Browse files
committed
docs(links): update README to reflect current link checkers
The rendered-content-link-checker.ts script and its rendered-content-link-checker-cli npm command were removed when the link-checking system was rebuilt, but src/links/README.md still documented them, including obsolete options (--level, --check-external-links). Replace them with the current checkers (check-links-pr, check-links-internal, check-links-external), document their options, add the components/ path to the LinkPreviewPopover.tsx reference, and update the stale performance note. Signed-off-by: MeGaurav4 <gaurav3.141592@gmail.com>
1 parent 81ade08 commit 464ae26

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

src/links/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `src/links` directory manages:
1414

1515
### Components
1616

17-
- **`LinkPreviewPopover.tsx`**: A React component that renders a preview card when a user hovers over a link. It handles:
17+
- **`components/LinkPreviewPopover.tsx`**: A React component that renders a preview card when a user hovers over a link. It handles:
1818
- **Delay Logic**: Prevents the popover from appearing during accidental mouse-overs.
1919
- **Positioning**: Ensures the popover appears near the link without going off-screen.
2020

@@ -28,12 +28,9 @@ The `src/links` directory manages:
2828

2929
### Scripts (`src/links/scripts`)
3030

31-
- **`rendered-content-link-checker.ts`**: A comprehensive CLI tool that:
32-
- Renders content pages to HTML.
33-
- Parses the HTML to find all `<a>` and `<img>` tags.
34-
- Validates internal links (checking for 404s, broken anchors).
35-
- Validates external links (with caching and retry logic).
36-
- Reports flaws and can comment directly on GitHub Pull Requests.
31+
- **`check-links-pr.ts`**: Fast validation of internal links in the files changed by a pull request. Runs in under 10 minutes on typical PRs and can post flaws directly on the PR.
32+
- **`check-links-internal.ts`**: Comprehensive check of all internal links across all versions and languages. Designed to run as a scheduled workflow (twice weekly).
33+
- **`check-links-external.ts`**: Validates external URLs in content files. Designed to run weekly with aggressive caching.
3734
- **`check-github-github-links.ts`**: Ensures that we don't accidentally link to private `github/github` URLs in public documentation.
3835
- **`update-internal-links.ts`**: A CLI wrapper around the library function to perform bulk updates on the content files.
3936

@@ -44,13 +41,14 @@ The `src/links` directory manages:
4441
To run the link checker locally:
4542

4643
```bash
47-
npm run rendered-content-link-checker-cli
44+
npm run check-links-pr
45+
npm run check-links-internal
46+
npm run check-links-external
4847
```
4948

50-
Options:
51-
- `--level <all|critical|warning>`: Set the reporting level.
52-
- `--check-external-links`: Check external links (slower).
53-
- `--verbose`: Show detailed output.
49+
- `check-links-pr` validates internal links in the changed files of a pull request (optionally limited with `--files <paths>`).
50+
- `check-links-internal` checks all internal links across all versions and languages (optionally scoped with `--version <version>` and `--language <language>`).
51+
- `check-links-external` validates external URLs in content files (optionally limited with `--max <count>`).
5452

5553
### Updating Links
5654

@@ -74,6 +72,6 @@ This script typically relies on the state of the `content` directory to determin
7472

7573
## Current State & Known Issues
7674

77-
- **Performance**: The `rendered-content-link-checker` is resource-intensive because it renders pages. It uses concurrency limits and caching (especially for external links) to mitigate this.
75+
- **Performance**: The internal link checker is resource-intensive because it renders pages across all versions and languages. It uses concurrency limits and caching (especially for external links) to mitigate this.
7876
- **False Positives**: External link checking can be flaky due to temporary network issues or anti-bot protections on target sites. The system uses a "retry and cache" strategy to reduce noise.
7977
- **Liquid Complexity**: `update-internal-links` has to use regex and heuristics to parse Markdown mixed with Liquid, which is inherently fragile compared to a full AST parser, but necessary to preserve code formatting.

0 commit comments

Comments
 (0)