pydoc-markdown icon indicating copy to clipboard operation
pydoc-markdown copied to clipboard

Processing enhancement

Open ariG23498 opened this issue 5 years ago • 3 comments

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.

ariG23498 avatar Nov 26 '20 08:11 ariG23498

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 avatar Nov 27 '20 20:11 NiklasRosenstein

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

NiklasRosenstein avatar Nov 27 '20 20:11 NiklasRosenstein

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

ariG23498 avatar Nov 28 '20 08:11 ariG23498