-
Notifications
You must be signed in to change notification settings - Fork 17
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
Unpin mkdocs-autorefs and fix multple URLs for warnings #1051
Conversation
93fb407
to
1a1deca
Compare
Ready for review. |
This is in part to improve the docs but it was done also partially to solve the warning: "Multiple URLs found for ..." Probably just adding the new mkdocs options to the user-guide page would have been enough to remove the warning, but it still makes sense to move the high-level docs to the module anyway, so we keep that change too. Signed-off-by: Leandro Lucarella <[email protected]>
When multiple URLs were found for a autoref, the plugin emits a warning, which in our setup breaks the build as we use strict mode. This new option allows to resolve the reference to the "closest URL". See the documentation for more information: https://github.com/mkdocstrings/autorefs#non-unique-headings Signed-off-by: Leandro Lucarella <[email protected]>
Now that all warnings about "Multiple URLs for" were fixed, we can unpin `mkdocs-autorefs` and let it update to the latest version. Signed-off-by: Leandro Lucarella <[email protected]>
1a1deca
to
ded52da
Compare
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.
Just an optional comment, it can be cleaned up later as well.
|
||
### Composition | ||
Example: Streaming the power of a battery pool. | ||
```python |
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.
You're already saying please refer to the module documentation, so why can't they get their examples from there too? It looks a bit weird to have examples after the line that tells people to go elsewhere.
Besides, the formula engine examples already take so long in CI. Now it is going to be twice as long. :-((
This PR unpins the
mkdocs-autorefs
plugin, so we can use the latest version, but to do that we need to make some changes to the way we link to sections in the docs.The new version produces warnings when there are more than one possible URL to resolve an "autoref" link, and since we have strict more enabled, the docs fail to build if we have any warnings.
The simplest way to avoid the warning in some cases is just adding the following options:
This avoids anchors being created in the user guide, so it removes the ambiguity of the link.
To remove some other warnings we add a new
autorefs
plugin option toresolve_closest
, which allows to resolve the reference to the "closest URL". See the documentation for more information: https://github.com/mkdocstrings/autorefs#non-unique-headings.This PR was done following suggestions in: