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: Add tooling to check and validate build: #447

Merged
merged 37 commits into from
Jun 25, 2024

Conversation

kirkrodrigues
Copy link
Member

@kirkrodrigues kirkrodrigues commented Jun 17, 2024

  • Add script to check for invalid links
  • Add workflow to validate build
  • Fail on warnings
  • Fix invalid link in log-viewer-webui README

Description

When Sphinx generates an html file from a Markdown file, it will automatically translate relative links with the .md suffix to use the .html suffix. However, it doesn't/can't do this for:

  • sphinx cards;
  • READMEs that are outside the docs site (in other words, outside the docs directory);
  • absolute links that include the docs.yscope.com prefix.

This PR:

  • Adds a script to check for invalid links, namely:
    • Links to https://docs.yscope.com that include the .md suffix; if at all, they should include .html as the suffix, or better yet, no suffix at all.
    • :link: attributes in sphinx cards that include the .md suffix; again, they should include no suffix at all.
    • This script is added as a step in the build since invalid links will lead to an invalid build.
    • This script also generates errors using GH Action's workflow command syntax.
  • Fixes the invalid link in components/log-viewer-webui/README.md
  • Updates the sphinx build command to fail on warnings.
  • Adds a workflow to validate building the docs on both Ubuntu and macOS.

Validation performed

  • Validated that https://docs.yscope.com links that include the .md suffix are detected and fail the build.
  • Validated that http://docs.yscope.com links that include the .md suffix are detected and fail the build.
  • Validated that sphinx card :link: attributes that include the .md suffix are detected and fail the build.
  • Validated that warnings fail the build.
  • Validated that invalid link errors show up as annotations on GH.
    • Note that annotations only work for files changed in the most recent comment.

Copy link
Collaborator

@Henry8192 Henry8192 left a comment

Choose a reason for hiding this comment

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

A trivial change for regex, other changes LGTM :)

tools/scripts/find-broken-docs-links.py Outdated Show resolved Hide resolved
tools/scripts/find-broken-docs-links.py Outdated Show resolved Hide resolved
@kirkrodrigues kirkrodrigues merged commit 14d9234 into y-scope:main Jun 25, 2024
4 checks passed
@kirkrodrigues kirkrodrigues deleted the docs-workflow branch June 25, 2024 22:48
jackluo923 pushed a commit to jackluo923/clp that referenced this pull request Dec 4, 2024
- Add script to check for invalid links.
- Add workflow to validate build.
- Fail on warnings.
- Fix invalid link in log-viewer-webui README.

Co-authored-by: Henry8192 <[email protected]>
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