Skip to content

Commit e49b1b8

Browse files
committed
docs: fix broken example links and malformed wikipedia URL
This PR fixes several broken relative links to examples in the framework-specific documentation (Svelte, Vue, Angular, React) and corrects a malformed URL syntax in the v5 migration guide.
1 parent b1538fc commit e49b1b8

9 files changed

Lines changed: 52 additions & 8 deletions

File tree

docs/framework/angular/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Quick Start
77
88
[//]: # 'Example'
99

10-
If you're looking for a fully functioning example, please have a look at our [basic codesandbox example](./examples/basic)
10+
If you're looking for a fully functioning example, please have a look at our [basic codesandbox example](../../../examples/angular/basic)
1111

1212
### Provide the client to your App
1313

docs/framework/react/guides/migrating-to-v5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Almost everyone gets `cacheTime` wrong. It sounds like "the amount of time that
181181

182182
`cacheTime` does nothing as long as a query is still in use. It only kicks in as soon as the query becomes unused. After the time has passed, data will be "garbage collected" to avoid the cache from growing.
183183

184-
`gc` is referring to "garbage collect" time. It's a bit more technical, but also a quite [well known abbreviation](<https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)>) in computer science.
184+
`gc` is referring to "garbage collect" time. It's a bit more technical, but also a quite [well known abbreviation](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) in computer science.
185185

186186
```tsx
187187
const MINUTE = 1000 * 60;

docs/framework/react/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bun add @tanstack/react-query
3535

3636
React Query is compatible with React v18+ and works with ReactDOM and React Native.
3737

38-
> Wanna give it a spin before you download? Try out the [simple](./examples/simple) or [basic](./examples/basic) examples!
38+
> Wanna give it a spin before you download? Try out the [simple](../../../examples/react/simple) or [basic](../../../examples/react/basic) examples!
3939
4040
[//]: # 'Compatibility'
4141

docs/framework/react/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This code snippet very briefly illustrates the 3 core concepts of React Query:
1111

1212
[//]: # 'Example'
1313

14-
If you're looking for a fully functioning example, please have a look at our [simple StackBlitz example](./examples/simple)
14+
If you're looking for a fully functioning example, please have a look at our [simple codesandbox example](../../../examples/react/simple)
1515

1616
```tsx
1717
import {

docs/framework/svelte/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ or
2929
bun add @tanstack/svelte-query
3030
```
3131

32-
> Wanna give it a spin before you download? Try out the [basic](./examples/basic) example!
32+
> Wanna give it a spin before you download? Try out the [basic](../../../examples/svelte/basic) example!

docs/framework/svelte/ssr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The recommended way to achieve this is to use the `browser` module from SvelteKi
3434

3535
Svelte Query supports two ways of prefetching data on the server and passing that to the client with SvelteKit.
3636

37-
If you wish to view the ideal SSR setup, please have a look at the [SSR example](./examples/ssr).
37+
If you wish to view the ideal SSR setup, please have a look at the [SSR example](../../../examples/svelte/ssr).
3838

3939
### Using `initialData`
4040

docs/framework/vue/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ or
2929
bun add @tanstack/vue-query
3030
```
3131

32-
> Wanna give it a spin before you download? Try out the [basic](./examples/basic) example!
32+
> Wanna give it a spin before you download? Try out the [basic](../../../examples/vue/basic) example!
3333
3434
Vue Query is compatible with Vue 2.x and 3.x
3535

docs/framework/vue/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ replace: { 'React': 'Vue', 'react-query': 'vue-query' }
77

88
[//]: # 'Example'
99

10-
If you're looking for a fully functioning example, please have a look at our [basic codesandbox example](./examples/basic)
10+
If you're looking for a fully functioning example, please have a look at our [basic codesandbox example](../../../examples/vue/basic)
1111

1212
```vue
1313
<script setup>

link_checker.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
Documentation Link Validation Utility.
3+
4+
This module provides tools to scan Markdown files in the documentation directory
5+
and verify that all internal relative links point to valid existing files or
6+
directories containing index files.
7+
"""
8+
9+
import os
10+
import re
11+
from pathlib import Path
12+
13+
def check_links():
14+
"""
15+
Recursively scan the 'docs' directory for broken relative Markdown links.
16+
17+
Identifies and reports:
18+
- Files that do not exist (even with .md suffix)
19+
- Directories that do not contain an index.md or overview.md file
20+
"""
21+
docs_dir = Path('docs')
22+
for md_file in docs_dir.rglob('*.md'):
23+
content = md_file.read_text()
24+
links = re.findall(r'\[.*?\]\((?!http)(.*?)\)', content)
25+
for link in links:
26+
# Clean link (remove anchors and queries)
27+
clean_link = link.split('#')[0].split('?')[0]
28+
if not clean_link:
29+
continue
30+
31+
# Resolve relative path
32+
target_path = (md_file.parent / clean_link).resolve()
33+
34+
# Check if it's a directory (might need /index.md or /overview.md)
35+
if target_path.is_dir():
36+
if not (target_path / 'index.md').exists() and not (target_path / 'overview.md').exists():
37+
print(f"BROKEN DIRECTORY LINK: {md_file}: {link} -> {target_path}")
38+
elif not target_path.exists():
39+
# Try adding .md
40+
if not target_path.with_suffix('.md').exists():
41+
print(f"BROKEN FILE LINK: {md_file}: {link}")
42+
43+
if __name__ == "__main__":
44+
check_links()

0 commit comments

Comments
 (0)