Cli link2docs#1344
Conversation
There was a problem hiding this comment.
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.0release notes to therelease/v2.1.0docs site path. - Narrow Lychee’s Markdown scan from
./**/*.mdto only./*.mdwhile 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.
| 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 |
There was a problem hiding this comment.
Agree this would be better as README.md
There was a problem hiding this comment.
I agree... But for some reason, this doesn't work
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
alexdewar
left a comment
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
Agree this would be better as README.md
There was a problem hiding this comment.
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>
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:
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
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks