-
Notifications
You must be signed in to change notification settings - Fork 3
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 linkcheck to docs build #24
Conversation
@@ -102,9 +102,12 @@ build_sphinx_docs: | |||
- uses: neuroinformatics-unit/actions/build_sphinx_docs@main | |||
with: | |||
python-version: 3.10 | |||
check-links: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default is indeed true, but in the README usage example I show how you would deactivate it. Because it defaults to true, there is no point in including check-links: true
when using the action (it's redundant). But if you think it's confusing I can either remove that line from the usage example, or change it to true (redundancy doesn't hurt in this case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that makes sense. Let's keep it like this then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @niksirbi. I haven't merged yet because you mentioned letting @neuroinformatics-unit/neuroinformatics-all take a look first.
I raised brainglobe/brainglobe.github.io#97 to track this within BrainGlobe. cc @alessandrofelder
This looks great! I don't have anything to add in terms of the implementation, happy to test this on other repos if required. |
I think everyone who maintains Sphinx docs has weighed in, so I'll merge |
UpdateThis appears to be working:
Shall I make a new release of the actions? |
Description
What is this PR
Why is this PR needed?
We often encounter broken links in our documentation websites, either because of typos, or because the links changed.
What does this PR do?
It adds an extra step to the build-docs action for checking the integrity of external links.
This step will be enabled by default, by can be deactivated via
check-links: false
(in case it produces annoying false positives for some projects)References
neuroinformatics-unit/movement#80
neuroinformatics-unit/NeuroBlueprint#50
How has this PR been tested?
I tested the sphinx-build process locally. The real test will come after merging to
main
. If this fails, I should be able to tell viamovement
(which uses neuroinformatics-unit/actions/build_sphinx_docs@main).After ensuring that
movement
behaves as intended, we can release this action, and after that, it will affect all repos that use neuroinformatics-unit/actions/build_sphinx_docs@v2.Is this a breaking change?
Not per se, but it may lead to some docs build errors if some projects contain broken links. That's why I'm tagging @neuroinformatics-unit/neuroinformatics-all so that everyone is aware of this possibility and is not surprised.
You can debug the linkcheck step by running it locally:
If the linkcheck step produces "false positives" for your project (i.e. marking valid links as broken), you have two options:
conf.py
(replace with the problematic URLs).check-links
input tofalse
, e.g.:Does this PR require an update to the documentation?
Documented in the relevant READMEs.
Checklist: