NiklasRosenstein / pydoc-markdown

Create Python API documentation in Markdown format.
http://niklasrosenstein.github.io/pydoc-markdown/
Other
453 stars 102 forks source link

Proposal for fixing sphinx multi-line parsing error #223

Closed gmarks2149 closed 2 years ago

gmarks2149 commented 2 years ago

This is a proposal for a way to fix the issue with multi-line docstrings. This adds a dependency for docstring_parser and uses that to do the docstring parsing. That parser handles the multi-line docstrings already.

I'm not sure if you want to utilize that package or not.

I verified that this passes all the sphinx processor tests. There is one caveat. It seems like this adds a newline in the test for the codeblock example. I'm not sure if the changed behavior is acceptable or not. I've modified the test in this PR to account for that relatively minor change.

I'm open to any feedback regarding these changes.

NiklasRosenstein commented 2 years ago

Thank you @gmarks2149, this looks great 👍 I think the newline is acceptable. Ultimately it doesn't have an effect to the rendered output in most Markdown renderers (probably also according to the specification).

Could I ask you to do the following before I merge this?

gmarks2149 commented 2 years ago

@NiklasRosenstein I've made the updates to add the dependency constraint and changelog entry. Hopefully the package.yaml syntax is correct. I just used the style the other entries were using. I'm glad this approach works for you and appreciate you taking the changes!

NiklasRosenstein commented 2 years ago

👍 Thank you