Skip to content

docs: Add tooling to check and validate build:#447

Merged
kirkrodrigues merged 37 commits into
y-scope:mainfrom
kirkrodrigues:docs-workflow
Jun 25, 2024
Merged

docs: Add tooling to check and validate build:#447
kirkrodrigues merged 37 commits into
y-scope:mainfrom
kirkrodrigues:docs-workflow

Conversation

@kirkrodrigues

@kirkrodrigues kirkrodrigues commented Jun 17, 2024

Copy link
Copy Markdown
Member
  • 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.

@Henry8192 Henry8192 left a comment

Copy link
Copy Markdown
Contributor

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 :)

Comment thread tools/scripts/find-broken-docs-links.py Outdated
Comment thread tools/scripts/find-broken-docs-links.py Outdated
kirkrodrigues and others added 2 commits June 25, 2024 18:43
Co-authored-by: Henry8192 <50559854+Henry8192@users.noreply.github.com>
@kirkrodrigues kirkrodrigues merged commit 14d9234 into y-scope:main Jun 25, 2024
@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 <50559854+Henry8192@users.noreply.github.com>
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
- 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 <50559854+Henry8192@users.noreply.github.com>
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