Skip to content
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

Docs: Fix dead links and invalid hashes #1356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

julien-deramond
Copy link
Contributor

@julien-deramond julien-deramond commented Sep 27, 2024

Description

I've spotted a dead link while browsing the documentation, and since I knew that you're using Starlight, I tried to install and execute starlight-links-validator.

The primary goal of this PR is to fix the dead links and invalid hashes, but it also includes a possible enhancement for the project by using starlight-links-validator.

Installing starlight-links-validator

The first commit of this PR (8726ef1) shows how to install starlight-links-validator.

  1. If you don't want to install it for whatever reason, I can remove this commit. Just wanted to show you how it works.
  2. ⚠️ If you'd like to keep starlight-links-validator, there will be a fix to do in this PR as I had to comment a line in docs/src/remark-playground.ts. I haven't especially tried to fix this properly, I preferred to know before whether you would like to include starlight-links-validator in your build :)

Fix dead links and invalid hashes in the doc

Here's the output of running npm run docs:build with starlight-links-validator enabled in the project:

13:46:07 [ERROR] ✗ Found 36 invalid links in 8 files.
13:46:07 ▶ info/package_structure/
13:46:07   └─ /references/info/tokens - invalid link
13:46:07 ▶ info/tokens/
13:46:07   └─ /reference/hooks/transforms#attributecti - invalid hash
13:46:07 ▶ reference/hooks/formats/
13:46:07   ├─ predefined - relative link
13:46:07   ├─ predefined - relative link
13:46:07   ├─ /reference/hooks/filter - invalid link
13:46:07   ├─ /reference/hooks/filter - invalid link
13:46:07   ├─ predefined/#cssvariables - relative link
13:46:07   ├─ predefined/#scssvariables - relative link
13:46:07   ├─ predefined/#lessvariables - relative link
13:46:07   ├─ predefined/#androidresources - relative link
13:46:07   ├─ predefined/#composeobject - relative link
13:46:07   ├─ predefined/#ios-swiftclassswift - relative link
13:46:07   ├─ predefined/#flutterclassdart - relative link
13:46:07   └─ /reference/hooks/formats#fileheader - invalid hash
13:46:07 ▶ reference/hooks/transform-groups/predefined/
13:46:07   ├─ /reference/hooks/transforms/predefined#sizeflutterremToDouble - invalid hash
13:46:07   └─ /reference/hooks/transforms/predefined#sizeflutterremToDouble - invalid hash
13:46:07 ▶ reference/hooks/formats/predefined/
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   ├─ #references-in-output-files - invalid hash
13:46:07   └─ #references-in-output-files - invalid hash
13:46:07 ▶ reference/hooks/transforms/predefined/
13:46:07   └─ /info/tokens#category-type-item - invalid hash
13:46:07 ▶ reference/api/
13:46:07   ├─ /references/hooks/file-headers - invalid link
13:46:07   ├─ /references/hooks/formats#creating-formats - invalid link
13:46:07   └─ /reference/hooks/transform_groups - invalid link
13:46:07 ▶ reference/config/
13:46:07   ├─ /reference/tokens - invalid link
13:46:07   ├─ /reference/using_the_cli - invalid link
13:46:07   ├─ /reference/using_the_cli - invalid link
13:46:07   ├─ /reference/using_the_npm_module - invalid link
13:46:07   ├─ /reference/hooks/format#references-in-output-files - invalid link
13:46:07   └─ /reference/hooks/formats#customfileheader - invalid hash

Based on these results, I tried to find the correct target URLs in b672395. Hope I haven't made too many mistakes 😬

Fix invalid hashes in the library

Finally, one of these invalid hashes was also in the comments of the library, so has been fixed along the way via 94e3a38.

Final words

In the end, this PR gathers different elements.
Based on your feedback, I can remove/modify the commits, or split the PR.
Please note that I haven't added any changesets, waiting for a first feedback on how to proceed :)


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@julien-deramond julien-deramond requested a review from a team as a code owner September 27, 2024 12:26
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1356.d16eby4ekpss5y.amplifyapp.com

@julien-deramond julien-deramond force-pushed the main-jd-fix-failed-links-validation branch from 94e3a38 to 84b314d Compare October 1, 2024 19:08
@jorenbroekema jorenbroekema force-pushed the main-jd-fix-failed-links-validation branch from 8d5ce60 to 7489fce Compare October 11, 2024 09:17
Copy link
Collaborator

@jorenbroekema jorenbroekema left a comment

Choose a reason for hiding this comment

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

Approved and fixed the type issues in the remark-playground file, then squashed the commits into 1.

Thanks for the contribution :)

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