Closed kellyjonbrazil closed 2 years ago
I also had this problem and had to modify the renderer.
This is simply because pydoc-markdown read the source code into a docspec.ApiObject
then parsing it to text. So it loses all spacings and line breaks.
I use black formatter to beautify the code. Maybe I'll open a pull request in a couple of days adding this feature.
not sure if this PR is relevant: https://github.com/NiklasRosenstein/pydoc-markdown/pull/78
Hey all, inspired by @lgeiger's original PR (#78), I've added formatting the function, class and variable signatures with YAPF to the MarkdownRenderer in this PR: https://github.com/NiklasRosenstein/pydoc-markdown/pull/245. It'll be part of the 4.6.0 release.
Environment
Describe the bug
pydoc-markdown is not pretty formatting function definitions with type annotations.
I have a fairly involved function definition that I have formatted over several lines in my code, but pydoc-markdown seems to pull it all into a single line. Function definitions without type annotations seem to format nicely enough.
Is there a way to control this via configuration?
Here is my function definition:
and here is the resulting code block in the markdown file:
pydoc-markdown doesn't seem to pull the yapf configuration from my
.style.yapf
file. I wonder if that would be an option if it is not already configurable?Expected behavior
I would like to be able to have each argument on its own line as can be achieved with
SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED: True
in yapf style configuration.