Parse indented numpy docstring examples#465
Conversation
3b80110 to
815812d
Compare
|
Thanks for the PR @gselzer. Have you considered simply not indenting your Also the rendering issue in pyapp-kit/scenex#89 might simply be due to the lack of a blank line between the markup and the |
Yes, that's what pyapp-kit/scenex#93 does, however it is clear to me now that I am prone to doing this, and in the case others are as well I figured a fix upstream couldn't hurt 😅
Umm, maybe, how is that different from the examples within the docstrings are being rendered now without pycon?
Based on a quick change and a local Zensical build that doesn't seem to be part of the issue 🙁 |
|
Ah right the markdown-pycon extension makes it possible to write Since de-denting such blocks in Examples sections works as expected, I'm gonna close this PR. I'll reconsider if more people run into this 🙂 Thanks again for your contribution! |

For reviewers
I've never dug into mkdocstrings before, so the LLM was useful for pinpointing the issue and suggesting a quick fix. Afterwards I slimmed down a rather verbose test 😅
Description of the change
This PR is designed to enable the parsing of numpy-style code examples that are nonuniformly indented. Sometimes authors (read: me) might want to indent a code example to highlight it amidst the larger section - but griffe doesn't pick those up.
This PR also includes a test that fails without the changes.
Relevant resources
This issue was spotted in pyapp-kit/scenex#89