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

Added a script to check the validity of docs links and a .github action #122

Merged
merged 15 commits into from
Jan 3, 2025

Conversation

cloutiertyler
Copy link
Contributor

@cloutiertyler cloutiertyler commented Dec 31, 2024

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 the nav.js file and the package.json file, and adds a new script for checking links in markdown files.

New GitHub Actions workflows:

Code updates and new scripts:

  • docs/nav.js: Refactors the page and section functions to use explicit parameter assignments and changes const to var for the nav object.
  • package.json: Updates dependencies and modifies the build script to output to the docs directory. Adds a new check-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 the nav.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.

cloutiertyler and others added 15 commits December 31, 2024 18:06
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.
Copy link
Contributor

@gefjon gefjon left a 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.

@cloutiertyler cloutiertyler merged commit eb6a3a2 into master Jan 3, 2025
2 checks passed
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