Skip to content

Cli link2docs#1344

Merged
AdrianDAlessandro merged 5 commits into
mainfrom
cli-link2docs
Jun 12, 2026
Merged

Cli link2docs#1344
AdrianDAlessandro merged 5 commits into
mainfrom
cli-link2docs

Conversation

@AdrianDAlessandro

@AdrianDAlessandro AdrianDAlessandro commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR removes most of the absolute links in the docs and replace them with relative links. This ensures that you will always stay inside the version of the docs that you are in (instead of unknowingly moving to the most recent version).

I left a couple instances of absolute links where I think it makes more sense for them to be:

  • The API docs placeholder page
  • In the release notes pages. These should always be absolute to the version they are referencing because those pages might disappear in the future.

To prevent link check failures, I updated it so that it only checks markdown files in the top level of the directory, so it won't flag broken relative links in the docs/ folder. It still checks all of the generated html docs.

Caveat: I'm am not 100% sure this will work with the rust book links (ie, linking to the relevant version of the rust book docs). It seemed to be correct when I built the docs and checked the html files locally, but I was not sure that I checked everything.

Fixes #1230

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copilot AI 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.

Pull request overview

This PR updates documentation hyperlinks to use relative paths (and version-pinned absolute links where appropriate) so readers browsing older published docs don’t get silently redirected to the latest docs version. It also adjusts the CI link-checker scope to avoid false failures from relative links that only resolve after docs generation.

Changes:

  • Convert many docs links from absolute https://.../MUSE2/... to relative *.md / relative site paths.
  • Pin links in v2.1.0 release notes to the release/v2.1.0 docs site path.
  • Narrow Lychee’s Markdown scan from ./**/*.md to only ./*.md while still scanning all generated HTML.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/user_guide.md Switches key doc references to relative links within the mdBook source tree.
docs/release_notes/v2.1.0.md Pins release-note links to the release/v2.1.0 documentation location.
docs/release_notes/upcoming.md Converts a developer-guide reference to a relative link.
docs/model/investment.md Replaces an absolute docs-site link with a relative one (one link target needs adjustment).
docs/developer_guide/setup.md Updates the justfile reference to point to GitHub instead of a local path.
docs/developer_guide/custom_highs_options.md Updates a file-format docs link to a relative path.
docs/developer_guide/architecture_quickstart.md Converts several docs-site/API-doc links to relative paths within the built docs output.
.github/workflows/check-docs.yml Restricts Markdown link checking scope while keeping HTML checks comprehensive.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/model/investment.md
the lowest-cost solution for meeting demand.

[framework-overview]: https://energysystemsmodellinglab.github.io/MUSE2/model/index.html#framework-overview
[framework-overview]: index.html#framework-overview

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree this would be better as README.md

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree... But for some reason, this doesn't work

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.54%. Comparing base (ab641e0) to head (f654153).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1344   +/-   ##
=======================================
  Coverage   89.54%   89.54%           
=======================================
  Files          58       58           
  Lines        8525     8525           
  Branches     8525     8525           
=======================================
  Hits         7634     7634           
  Misses        580      580           
  Partials      311      311           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexdewar alexdewar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, apart from a tweak to the lychee args.

Side note: I'm wondering whether it would be useful to have a just check-links command to run the link checker with the right args locally.

Comment thread .github/workflows/check-docs.yml Outdated
Comment thread docs/developer_guide/architecture_quickstart.md Outdated
Comment thread docs/developer_guide/architecture_quickstart.md Outdated
Comment thread docs/model/investment.md
the lowest-cost solution for meeting demand.

[framework-overview]: https://energysystemsmodellinglab.github.io/MUSE2/model/index.html#framework-overview
[framework-overview]: index.html#framework-overview

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree this would be better as README.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is ok, but note that these links didn't exist until the v2.1.0 release was made. If we do this going forward, then we'd have to remember to change links in docs/release_notes/upcoming.md before making the release (should probably be part of the checklist: #1264).

Co-authored-by: Alex Dewar <alexdewar@users.noreply.github.com>
@AdrianDAlessandro AdrianDAlessandro merged commit f75bc64 into main Jun 12, 2026
8 checks passed
@AdrianDAlessandro AdrianDAlessandro deleted the cli-link2docs branch June 12, 2026 12:11
@AdrianDAlessandro AdrianDAlessandro mentioned this pull request Jul 1, 2026
11 tasks
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.

Issue with absolute links in docs

3 participants