-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added a script to check the validity of docs links and a .github action #122
Conversation
Well, in at least some cases, just remove broken links. - The BSATN ref contained links to type defns, but didn't have type defns. Replace the links with plain text. - HTTP database links for recovery-code related routes were getting mangled in some way I couldn't figure out, so the links weren't working despite their targets clearly existing. Conveniently, those routes have been removed, so remove the links and the corresponding sections. - The JSON doc (erroneously called "SATN") contained typos, spelling "producttype" as "productype". - C# SDK ref had links to a section on the `Address` type, but no such section. Replace the links with plain text. - Rust SDK ref had a link getting mangled in a way I couldn't figure out. Simplify the section title so that the anchor name is predictable. - TypeSciprt SDK ref used camelCase names in anchor links, but we downcase all section titles to create anchor names. Also slap a section in README.md which says how to run the checker locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have run the script locally and can confirm that it identified several broken links, which I then fixed. I am not confident that it mangles header text into anchor names correctly. I have no particular reason to believe it does not, I'm just pointing out that I have not tested or validated that the actual website uses the same format for anchors.
This pull request introduces new GitHub Actions workflows for validating documentation links and ensuring that the
nav.ts
file builds correctly. Additionally, it includes updates to thenav.js
file and thepackage.json
file, and adds a new script for checking links in markdown files.New GitHub Actions workflows:
.github/workflows/check-links.yml
: Adds a workflow to check the validity of links in the documentation..github/workflows/validate-nav-build.yml
: Adds a workflow to validate that thenav.ts
file builds to match the committednav.js
file.Code updates and new scripts:
docs/nav.js
: Refactors thepage
andsection
functions to use explicit parameter assignments and changesconst
tovar
for thenav
object.package.json
: Updates dependencies and modifies thebuild
script to output to thedocs
directory. Adds a newcheck-links
script.scripts/checkLinks.ts
: Adds a new script to check for broken links in markdown files by comparing them against the slugs defined in thenav.ts
file.Testing
I ran this locally and verified that we have broken links. I would like to check that this action runs and does not allow merging.