Skip to content

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Sep 20, 2023

According to @pawamoy:

mkdocs-macros and mkdocstrings work at different levels: mkdocs-macros at the plugin level (in something like the on_page_markdown hook) while mkdocstrings renders docstrings at the Markdown conversion level, so in-between on_page_markdown and on_page_content. That means mkdocs-macros never sees the docstrings.

To fix this, we can implement a hack to plug both together in the define_env() function for mkdocs-macros.

Eventually a mkdocs-macros pluglet might be implemented so that this hack is not necessary anymore.

For more context see:

@llucax llucax requested a review from a team as a code owner September 20, 2023 09:03
@github-actions github-actions bot added part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) labels Sep 20, 2023
@llucax llucax self-assigned this Sep 20, 2023
@llucax llucax added this to the v1.0.0-rc2 milestone Sep 20, 2023
@llucax llucax enabled auto-merge September 20, 2023 09:05
According to @pawamoy:

> `mkdocs-macros` and `mkdocstrings` work at different levels:
> `mkdocs-macros` at the plugin level (in something like the
> `on_page_markdown` hook) while `mkdocstrings` renders docstrings at
> the Markdown conversion level, so in-between `on_page_markdown` and
> `on_page_content`. That means `mkdocs-macros` never sees the
> docstrings.

To fix this, we can implement a hack to plug both together in the
`define_env()` function for `mkdocs-macros`.

Eventually a `mkdocs-macros` *pluglet* might be implemented so that this
hack is not necessary anymore.

For more context see:

* mkdocstrings/mkdocstrings#615

Signed-off-by: Leandro Lucarella <[email protected]>
@llucax llucax force-pushed the fix-macros-docstrings branch from f4ba8ef to fac06af Compare September 20, 2023 09:26
@llucax llucax added this pull request to the merge queue Sep 20, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit a6f7964 Sep 20, 2023
@llucax llucax deleted the fix-macros-docstrings branch September 20, 2023 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants