NiklasRosenstein / pydoc-markdown

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

Processing enhancement #170

Open ariG23498 opened 3 years ago

ariG23498 commented 3 years ago

I do not think that while parsing the docstrin we should be using regex on each line of the docstring. https://github.com/NiklasRosenstein/pydoc-markdown/blob/0b8a85d84d063b5ce9a1fd73d88dda6a199d5583/pydoc-markdown/src/pydoc_markdown/contrib/processors/google.py#L139

Suppose:

Args:
    arg1 (int): This is a one liner
    arg2 (int): This
                    takes
                    multiple
                    lines

If we split the lines and apply regex then in the following block https://github.com/NiklasRosenstein/pydoc-markdown/blob/0b8a85d84d063b5ce9a1fd73d88dda6a199d5583/pydoc-markdown/src/pydoc_markdown/contrib/processors/google.py#L159 we will not be able to harness the description properly.

We can probably use something else here.

NiklasRosenstein commented 3 years ago

Hey @ariG23498 , it may not be super clean, but it's low effort and I think it works? I've added a test case for a parameter with multiple lines in the description. Please review 1084842

NiklasRosenstein commented 3 years ago

(Note something else is broken in the commit mentioned above but the unittest does pass)

ariG23498 commented 3 years ago

Hey @NiklasRosenstein Here is what I woud really like to see.