Skip to content
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

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

llucax
Copy link
Contributor

@llucax llucax commented Aug 26, 2024

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:

  show_root_heading: false
  show_root_toc_entry: false

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 to resolve_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:

@github-actions github-actions bot added part:docs Affects the documentation part:data-pipeline Affects the data pipeline part:actor Affects an actor ot the actors utilities (decorator, etc.) labels Aug 26, 2024
@github-actions github-actions bot added the part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) label Aug 26, 2024
@llucax llucax added this to the v1.0.0-rc900 milestone Aug 26, 2024
@llucax llucax added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Aug 26, 2024
@llucax llucax self-assigned this Aug 26, 2024
@llucax llucax force-pushed the fix-multiple-refs branch 2 times, most recently from 93fb407 to 1a1deca Compare September 2, 2024 07:01
@llucax llucax marked this pull request as ready for review September 2, 2024 07:05
@llucax llucax requested a review from a team as a code owner September 2, 2024 07:05
@llucax llucax requested review from Marenz and removed request for a team September 2, 2024 07:05
@llucax
Copy link
Contributor Author

llucax commented Sep 2, 2024

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 <luca-frequenz@llucax.com>
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 <luca-frequenz@llucax.com>
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 <luca-frequenz@llucax.com>
@llucax llucax added this pull request to the merge queue Sep 2, 2024
Copy link
Contributor

@shsms shsms left a 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
Copy link
Contributor

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. :-((

Merged via the queue into frequenz-floss:v1.x.x with commit 3842d77 Sep 2, 2024
18 checks passed
@llucax llucax deleted the fix-multiple-refs branch September 2, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd:skip-release-notes It is not necessary to update release notes for this PR part:actor Affects an actor ot the actors utilities (decorator, etc.) part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)
Projects
Development

Successfully merging this pull request may close these issues.

3 participants