-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
bug: Docstring Style Local Override Does Not Work #183
Comments
Thanks for the report @triley13 🙂 I suppose you expect all objects within Ideally we would distinguish that a local option was used, and instead of re-assigning a style, we would use the provided local style to parse docstrings. The issue is that we're not able to differentiate a global option from a local one once we're in the |
We can re-assign the style to the object and all its members, but note that Griffe extensions that modify the cached and parsed version of the docstring will probably stop working (because such extensions would be initially parsing and caching the docstring with the global style, not the local one). WDYT? |
Hey @pawamoy, sorry I've been on vacation for a bit. Is caching necessary? If it's not, then I would suggest making an implementation that only works without caching. Otherwise, is there a workaround for parsing the docstrings for a single page, and limiting the style change to a particular webpage? |
Hey again @triley13, thanks for your answer. I'm very inclined to do what you say and stop caching parsed versions of docstrings. Extensions should then never modify the parsed versions but only the "raw" docstring value. This is probably much less convenient though, programmatically speaking, since that means extensions have to manipulate a string instead of a proper data structure, but I'll think about it. Un-caching this is a no-brainer, it creates too many issues. I'll mark this as a refactor. |
I have opened a relevant issue in Griffe, see mkdocstrings/griffe#340 🙂 |
Description of the bug
Local override
docstring_style
for global configuration doesn't work.To Reproduce
Declare in mkdocs.yaml:
-->
Inside
file.md
Full traceback
Full traceback
Expected behavior
Override the default
google
style with thesphinx
style for that one module.Environment information
mkdocs
v1.6.0mkdocstrings
v0.26.0mkdocstrings-python
v1.10.5griffe
v0.47.0Additional context
I am using
path:
to load the module and I'm usingmkdocs-monorepo-plugin
.The text was updated successfully, but these errors were encountered: