-
-
Notifications
You must be signed in to change notification settings - Fork 52
-
Hi! How are Rust docstrings handled in mkdocstrings? For example, in this method I see all of the attributes, but they're missing descriptions:
image
When you go to the source code, we have the descriptions:
image
How do I port over the descriptions from Rust to mkdocstrings?
Beta Was this translation helpful? Give feedback.
All reactions
Hi @ccmao1130, thanks for the question 🙂 Griffe doesn't read Rust sources. I guess the API data is extracted from the compiled modules, and since you only added docs to the Rust sources and not into the compiled objects' docstrings, Griffe isn't able to see the docstrings. I suppose it's possible to write a Griffe extension that reads the Rust sources (more specifically, Pyo3 declarations) to enhance the collected data. The alternative would be to provide stubs files (*.pyi files) containing the same docstrings for each produced Python object, or to somehow instruct Pyo3 to see the __doc__ values on each object.
Feel free to open feature requests on our issue trackers 🙂
Replies: 1 comment
-
Hi @ccmao1130, thanks for the question 🙂 Griffe doesn't read Rust sources. I guess the API data is extracted from the compiled modules, and since you only added docs to the Rust sources and not into the compiled objects' docstrings, Griffe isn't able to see the docstrings. I suppose it's possible to write a Griffe extension that reads the Rust sources (more specifically, Pyo3 declarations) to enhance the collected data. The alternative would be to provide stubs files (*.pyi files) containing the same docstrings for each produced Python object, or to somehow instruct Pyo3 to see the __doc__ values on each object.
Feel free to open feature requests on our issue trackers 🙂
Beta Was this translation helpful? Give feedback.